2017-01-16 186 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服務器。或者你可以用它代替