0

我对我的 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 两个文件夹的内容:

禅:

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

有没有人有什么建议?为什么它仍然抱怨找不到文件?!...

谢谢=)

4

1 回答 1

1

将您的“Zend”符号链接更改为指向:

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

'ZendX' 看起来是正确的。ZF 应该能够Zend/Application.php在包含路径上找到,但您的符号链接指向 ZF 完整下载的根目录。

于 2013-01-11T09:15:17.087 回答