2017-01-16 185 views
1

在PHP/CDN错误,我们最近做了一个手动内部服务器的迁移和我们正在对我们的客户的网站,我们的一些静态网站都与他们的文件夹结构问题是什么?服务器迁移

This is an example of a website having issues - 你可以看到,它拿起CDN文件夹:

/CDNcss/bootstrap.min.css 

但最初的CDN文件夹实际上是小写和ofcourse斜线丢失 - 现在这个表面上可以通过排序改变包含cdn文件夹结构并添加一个斜杠,但这显然是一个关于初始文件设置的问题,因为声明只是被拾取为/现在在/包含一个名为settings.php的文件,下面的代码:

<?php 

date_default_timezone_set('Europe/London'); 
ini_set('display_errors',1); 
error_reporting(0); 

define("MODULEPATH", $_SERVER['DOCUMENT_ROOT']); 
define("CDN", 'http://splintaofficial.co.uk/cdn/'); 
define("BaseUrl", 'http://splintaofficial.co.uk/'); 

$DynamicMeta = 1; 
$RequestUri = $_SERVER["REQUEST_URI"]; 
$RequestUrl = explode("/", $RequestUri); 
$ScriptName = $_SERVER["SCRIPT_NAME"]; 

?> 

但剧本是我们的旧服务器上的工作完美?我们甚至还下调了PHP为这个特定的客户端网络空间回到5.5来测试它与PHP7/7.1任何东西 - 但它似乎没有它是什么?任何人都可以给出为什么会发生这种情况的任

做笔记,头文件打印以下(柜面的语法已经改变了什么!?这是我们还没有在迁移过程中改变任何东西,我不会想象....)

<link href="<?=CDN?>css/stylesheet.min.css" rel="stylesheet"> 

error_log里呈现出以下错误:

[Mon Jan 16 10:24:30.935391 2017] [autoindex:error] [pid 31974:tid 139637574072064] [client 54.226.66.8:33364] AH01276: Cannot serve directory /var/www/vhosts/splintaofficial.co.uk/httpdocs/cdn/: No matching DirectoryIndex (index.html,index.shtml,index.cfm,index.php,index.htm,index.php) found, and server-generated directory index forbidden by Options directive 

还有它允许从子域等服务内容的工作htaccess的,随时检查出也,如果我需要张贴这一点,让我知道。

+0

确保输出目录具有写权限和目前的所有权。CHMOD 777会做,但不是很安全。 –

回答

0

此错误:

[Mon Jan 16 10:24:30.935391 2017] [autoindex:error] [pid 31974:tid 139637574072064] [client 54.226.66.8:33364] AH01276: Cannot serve directory /var/www/vhosts/splintaofficial.co.uk/httpdocs/cdn/: No matching DirectoryIndex (index.html,index.shtml,index.cfm,index.php,index.htm,index.php) found, and server-generated directory index forbidden by Options directive 

意味着有传入的请求http://splintaofficial.co.uk/httpdocs/cdn/(注意吴丹没有文件名),但在目录中没有任何的索引文件/var/www/vhosts/splintaofficial.co.uk/httpdocs/cdn/

那么错误信息不看起来与<link href="<?=CDN?>css/stylesheet.min.css" rel="stylesheet">有关,或者该模板未呈现。

0

似乎代码:CSS/stylesheet.min.css”相对=‘样式’>不工作似乎没有被显示在CDN常量的值

你可以试试。通过在php.ini文件中启用短开放标签纠正这一点,并重新启动您的Web服务器。或者你可以用它代替