2013-01-11 29 views
0

我有點rid with我的Zend應用程序...我有一個完整的應用程序,我使用Zend框架開發了一個不同的服務器,現在我必須對軟件進行一些更改。我從服務器上下載所有的代碼,並做了所有必要的配置,我的信念,但我仍然得到日誌文件中出現以下錯誤:當試圖運行我的Zend應用程序時,我的包含路徑有什麼問題?

==> error.log <== 
[Fri Jan 11 10:49:53 2013] [error] [client 127.0.0.1] PHP Warning: require_once(Zend/Application.php): failed to open stream: No such file or directory in /home/jonne/Koulu/exercise_project/ProjectFiles/languageTest/application/application.php on line 18 
[Fri Jan 11 10:49:53 2013] [error] [client 127.0.0.1] PHP Fatal error: require_once(): Failed opening required 'Zend/Application.php' (include_path='/home/jonne/Koulu/exercise_project/ProjectFiles/languageTest/library:.:/usr/share/php:/usr/share/pear') in /home/jonne/Koulu/exercise_project/ProjectFiles/languageTest/application/application.php on line 18 

==> access.log <== 
127.0.0.1 - - [11/Jan/2013:10:49:53 +0200] "GET/HTTP/1.1" 500 274 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0" 

我充滿了這一點,因爲包含路徑似乎是正確的?我...

在路徑/home/jonne/Koulu/exercise_project/ProjectFiles/languageTest/library 我有兩個符號鏈接,其指向的位置:

Zend -> /home/jonne/Koulu/exercise_project/ZendFolder/Zend 
ZendX -> /home/jonne/Koulu/exercise_project/ZendFolder/ZendX 

下面是這兩個文件夾Zend和ZendX的內容:

的Zend:

drwxrwxrwx 2 jonne jonne 4096 Jan 11 10:12 bin 
-rwxrwxrwx 1 jonne jonne 928 Jun 13 2012 composer.json 
drwxrwxrwx 3 jonne jonne 4096 Jan 11 10:12 demos 
drwxrwxrwx 3 jonne jonne 4096 Jan 11 10:12 externals 
drwxrwxrwx 5 jonne jonne 4096 Jan 11 10:12 extras 
drwxrwxrwx 2 jonne jonne 4096 Jan 11 10:12 incubator 
-rwxrwxrwx 1 jonne jonne 3438 Apr 7 2009 INSTALL.txt 
drwxrwxrwx 3 jonne jonne 4096 Jan 11 10:12 library 
-rwxrwxrwx 1 jonne jonne 1548 Jan 6 2010 LICENSE.txt 
-rwxrwxrwx 1 jonne jonne 12209 Jun 22 2012 README.txt 
drwxrwxrwx 3 jonne jonne 4096 Jan 11 10:13 resources 
drwxrwxrwx 2 jonne jonne 4096 Jan 11 10:12 src 
drwxrwxrwx 4 jonne jonne 4096 Jan 11 10:12 tests 

ZendX:

drwxrwxrwx 3 jonne jonne 4096 Jan 11 10:13 Application 
drwxrwxrwx 3 jonne jonne 4096 Jan 11 10:13 Console 
drwxrwxrwx 4 jonne jonne 4096 Jan 11 10:13 Db 
-rwxrwxrwx 1 jonne jonne 1137 Sep 17 11:38 Exception.php 
drwxrwxrwx 5 jonne jonne 4096 Jan 11 10:13 JQuery 
-rwxrwxrwx 1 jonne jonne 4958 Sep 17 11:38 JQuery.php 

這裏是我的application.php代碼:

// Define path to application directory 
defined('APPLICATION_PATH') 
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application')); 

// Define application environment 
defined('APPLICATION_ENV') 
    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'development')); 

// Ensure library/ is on include_path 
set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH . '/../library'), 
    get_include_path(), 
))); 

/** Zend_Application */ 
require_once 'Zend/Application.php'; 
// Create application, bootstrap, and run 
$application = new Zend_Application(
    APPLICATION_ENV, 
    APPLICATION_PATH . '/configs/application.ini' 

); 

$application->bootstrap()->run(); 

這裏是的application.ini

內容
[production] 
phpSettings.display_startup_errors = 0 
phpSettings.display_errors = 0 
includePaths.library = APPLICATION_PATH "/../library" 
bootstrap.path = APPLICATION_PATH "/Bootstrap.php" 
bootstrap.class = "Bootstrap" 
appnamespace = "Application" 
;resources.frontController.defaultControllerName = "login" 
;resources.frontController.defaultAction = "login" 
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers" 
resources.frontController.params.displayExceptions = 0 
resources.view = "" 
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts" 
resources.layout.layout = "main" 


[staging : production] 

[testing : production] 
phpSettings.display_startup_errors = 1 
phpSettings.display_errors = 1 

[development : production] 
phpSettings.display_startup_errors = 1 
phpSettings.display_errors = 1 
resources.frontController.params.displayExceptions = 1 

有沒有人有任何建議?爲什麼它仍然抱怨找不到文件...

日Thnx =)

回答

1

改變你的'Zend的符號鏈接的指向:?!

Zend -> /home/jonne/Koulu/exercise_project/ZendFolder/Zend/library/Zend 

的 'ZendX' 一個看起來是正確的。 ZF應該能夠在包含路徑上找到Zend/Application.php,但符號鏈接指向ZF完整下載的根目錄。

+0

謝謝,我會試試=) – jjepsuomi

+0

是的!這就是訣竅! :)滑稽......我沒有考慮到這一點,因爲我記得它甚至只是通過符號鏈接到Zend根文件夾...我猜錯了,然後= D再次謝謝你=) – jjepsuomi

相關問題