Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/263.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将Zend从LAMP移动到共享服务器错误 致命错误:未捕获异常“UnexpectedValueException”和消息 'DirectoryIterator::_构造(/modules)[]: 无法打开目录:中没有这样的文件或目录 /home/www/zf/library/Zend/Controller/Front.php:289堆栈跟踪: #0/home/www/zf/library/Zend/Controller/Front.php(289):DirectoryIterator->\uu构造(“/modules”) #1/home/www/zf/library/Zend/Application/Resource/Frontcontroller.php(72):Zend_Controller_Front->addModuleDirectory(“/modules”) #2/home/www/zf/library/Zend/Application/Bootstrap/BootstrapAbstract.php(683):Zend_Application_Resource_Frontcontroller->init() #3/home/www/zf/library/Zend/Application/Bootstrap/BootstrapAbstract.php(626):Zend\u Application\u Bootstrap\u BootstrapAbstract->\u executesource('frontcontroller')) #4/home/www/zf/library/Zend/Application/Bootstrap/BootstrapAbstract.php(586):Zend\u Application\u Bootstrap\u BootstrapAbstract->\u Bootstrap(空) #5/home/www/zf/library/Zend/Application.php(355):第292行的Zend_Application_Boot in/home/www/zf/library/Zend/Controller/Front.php_Php_Zend Framework - Fatal编程技术网

将Zend从LAMP移动到共享服务器错误 致命错误:未捕获异常“UnexpectedValueException”和消息 'DirectoryIterator::_构造(/modules)[]: 无法打开目录:中没有这样的文件或目录 /home/www/zf/library/Zend/Controller/Front.php:289堆栈跟踪: #0/home/www/zf/library/Zend/Controller/Front.php(289):DirectoryIterator->\uu构造(“/modules”) #1/home/www/zf/library/Zend/Application/Resource/Frontcontroller.php(72):Zend_Controller_Front->addModuleDirectory(“/modules”) #2/home/www/zf/library/Zend/Application/Bootstrap/BootstrapAbstract.php(683):Zend_Application_Resource_Frontcontroller->init() #3/home/www/zf/library/Zend/Application/Bootstrap/BootstrapAbstract.php(626):Zend\u Application\u Bootstrap\u BootstrapAbstract->\u executesource('frontcontroller')) #4/home/www/zf/library/Zend/Application/Bootstrap/BootstrapAbstract.php(586):Zend\u Application\u Bootstrap\u BootstrapAbstract->\u Bootstrap(空) #5/home/www/zf/library/Zend/Application.php(355):第292行的Zend_Application_Boot in/home/www/zf/library/Zend/Controller/Front.php

将Zend从LAMP移动到共享服务器错误 致命错误:未捕获异常“UnexpectedValueException”和消息 'DirectoryIterator::_构造(/modules)[]: 无法打开目录:中没有这样的文件或目录 /home/www/zf/library/Zend/Controller/Front.php:289堆栈跟踪: #0/home/www/zf/library/Zend/Controller/Front.php(289):DirectoryIterator->\uu构造(“/modules”) #1/home/www/zf/library/Zend/Application/Resource/Frontcontroller.php(72):Zend_Controller_Front->addModuleDirectory(“/modules”) #2/home/www/zf/library/Zend/Application/Bootstrap/BootstrapAbstract.php(683):Zend_Application_Resource_Frontcontroller->init() #3/home/www/zf/library/Zend/Application/Bootstrap/BootstrapAbstract.php(626):Zend\u Application\u Bootstrap\u BootstrapAbstract->\u executesource('frontcontroller')) #4/home/www/zf/library/Zend/Application/Bootstrap/BootstrapAbstract.php(586):Zend\u Application\u Bootstrap\u BootstrapAbstract->\u Bootstrap(空) #5/home/www/zf/library/Zend/Application.php(355):第292行的Zend_Application_Boot in/home/www/zf/library/Zend/Controller/Front.php,php,zend-framework,Php,Zend Framework,这就是我犯的错误。我已经检查了所有的路径,看起来都是正确的。我不知道这个错误是怎么回事。请帮忙 这是我的index.php Fatal error: Uncaught exception 'UnexpectedValueException' with message 'DirectoryIterator::__construct(/modules) [<a href='directoryiterator.--construct'>directoryiterator.--constr

这就是我犯的错误。我已经检查了所有的路径,看起来都是正确的。我不知道这个错误是怎么回事。请帮忙

这是我的index.php

Fatal error: Uncaught exception 'UnexpectedValueException' with message 
'DirectoryIterator::__construct(/modules) [<a href='directoryiterator.--construct'>directoryiterator.--construct</a>]: 
failed to open dir: No such file or directory' in 
/home/www/zf/library/Zend/Controller/Front.php:289 Stack trace: 
#0 /home/www/zf/library/Zend/Controller/Front.php(289): DirectoryIterator->__construct('/modules') 
#1 /home/www/zf/library/Zend/Application/Resource/Frontcontroller.php(72): Zend_Controller_Front->addModuleDirectory('/modules') 
#2 /home/www/zf/library/Zend/Application/Bootstrap/BootstrapAbstract.php(683): Zend_Application_Resource_Frontcontroller->init() 
#3 /home/www/zf/library/Zend/Application/Bootstrap/BootstrapAbstract.php(626): Zend_Application_Bootstrap_BootstrapAbstract->_executeResource('frontcontroller') 
#4 /home/www/zf/library/Zend/Application/Bootstrap/BootstrapAbstract.php(586): Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap(NULL)
#5 /home/www/zf/library/Zend/Application.php(355): Zend_Application_Boot in /home/www/zf/library/Zend/Controller/Front.php on line 292

您的
应用程序路径
看起来错误。如果您乐于硬编码,您可能希望:

<?php

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

//path for public
defined('PUBLIC_PATH')
    || define('PUBLIC_PATH', realpath(dirname(__FILE__) . '/home/www/iops.axeleron.biz'));


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

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




/** Zend_Application */
require_once 'Zend/Application.php';


// Create application, bootstrap, and run
$application = new Zend_Application(
    APPLICATION_ENV,
    APPLICATION_PATH . '/home/www/mf/application/configs/application.ini'
);
$application->bootstrap()
            ->run();
对下面的
公共路径
行也应用相同的更改

一般来说,您不想硬编码路径,您以前可能有:

defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', '/home/www/mf/application'));

这应该仍然有效。这将使用当前文件的路径计算应用程序路径。

谢谢大家的回复。我自己解决了这个问题。我的服务器需要到处都有硬编码的路径,所以我在config和index.php中做了这些更改,它的工作非常出色


谢谢你的帮助

你在那里得到的所有
/home/www/
中都有一些棘手的东西。。。你对你的目录结构做了什么?它真的那么复杂吗?我在子域iops.axeleron.biz下得到了我的公共文件我在文件夹“zf”中得到了zendframework,在目录“mf”中从LAMP得到了zend项目文件我在进行您建议的更改时得到了这个错误?警告:require_once(Zend/Application.php)[function.require once]:未能打开流:第28行的/home/www/iops.axeleron.biz/index.php中没有这样的文件或目录致命错误:require_once()[function.require]:未能打开所需的“Zend/Application.php”(include_path=”::/usr/local/php5.3/lib//php)在第28Ah行的/home/www/iops.axeleron.biz/index.php中,是的,您的包含路径部分也不正确。将此行更改为:
realpath(APPLICATION_PATH./home/www/zf/library'),
realpath('/home/www/zf/library'),
defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));