2012-12-20 29 views
0

我目前正在開發一個使用最新Slim版本的Web應用程序。在我的專業計算機上運行(在Ubuntu 12.04上運行)時,一切都完美無瑕,但我想在假期期間在家爲項目工作。因此,我已將該項目複製到個人計算機上(在Mac OS X 10.6.8上運行)。問題是我總是收到空白頁。它看起來不是一個重寫問題,因爲即使使用醜陋的地址,它也不起作用。使用SLIM PHP框架的空白頁面

請在下面找到可能有助於解決問題的文件和信息。

文件夾結構(/用戶/約恩/網站/ DS)

-.htaccess 
- index.php 
- vendor/ 
- utils/ 
- services/ 

的utils的服務目錄中包含一些PHP類和感興趣的解決我的問題沒有。

htaccess的

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^(.*)$ /index.php [QSA,L] 

的index.php(樣品)

<?php 

require_once 'vendor/autoload.php'; 
function autoload_class_multiple_directory($class_name) 
{ 
    # List all the class directories in the array. 
    $array_paths = array(
     'utils/', 
     'services/' 
    ); 

    foreach($array_paths as $path) 
    { 
     $file = sprintf('./%s%s.class.php', $path, strtolower($class_name)); 
     if(is_file($file)) 
     {   
      include_once $file; 
     } 
    } 
} 

spl_autoload_register('autoload_class_multiple_directory'); 

error_reporting(E_ALL); 
ini_set('display_errors','On'); 

$app = new \Slim\Slim(array(
    "MODE" => "debug" 
)); 

/* ********************************** 
*   ROUTE DEFINITIONS 
* **********************************/ 
$arrDs = array("generator" => new Generator(), 
       "average" => new Average() 
       ); 

$app->get('/', function() use ($app,$arrDs){ 
    echo "dans la fonction de base !!! <br/>"; 
    foreach ($arrDs as $name => $obj){ 
     echo $name ."<br/>"; 
    } 
}); 

$app->run(); 
?> 

我使用定義爲

<VirtualHost *:80> 
ServerAdmin [email blocked] 
DocumentRoot "/Users/Yoann/Sites/DS" 
ServerName ds.local 
ErrorLog "/private/var/log/apache2/ds-error_log" 
CustomLog "/private/var/log/apache2/ds-access_log" combined 


    <Directory "/Users/Yoann/Sites/DS"> 
     AllowOverride All 
     Order allow,deny 
     Allow from all 
    </Directory> 
</VirtualHost> 

回答

1

在開發環境中的虛擬主機總是設置使用error_reporting爲E_ALL和display_errors爲true。

php.ini: 
display_errors = On 
error_reporting = E_ALL 

你會看到所有的錯誤,警告等等

+0

我忘了提到它,但是這兩條線已經在我的php.ini文件。關鍵是我沒有任何錯誤/調試/信息消息... –

+0

apache日誌呢? –

+0

沒有錯誤... –