我正在使用带有 log4php 和 smarty 的 zend 框架,在尝试运行 Zend 的引导程序时遇到了以下问题。
这是我得到的错误:
PHP Warning: require_once(Smarty.php): failed to open stream:
No such file or directory in /var/www/html/kb/vaserver/VaDaemon/config.php on line 37 pid
6049
Fatal error: require_once(): Failed opening required 'Smarty.php'
我认为我的问题与此处提到的以下问题非常相似,但是这个错误已经解决并修复了,我看到修复与詹姆斯在那里写的类似。无论如何,如您所见,这不起作用,所以我想知道我还应该尝试什么。
这是我的 config.php 代码:
/** *
date_default_timezone_set('Etc/UTC');
// The custom error handlers that ship with PHP Simple Daemon respect all PHP INI error settings.
ini_set('error_log', '/var/log/phpcli');
ini_set('display_errors', 0);
// Define a simple Auto Loader:
// Add the current application and the PHP Simple Daemon ./Core library to the existing include path
// Then set an __autoload function that uses Zend Framework naming conventions.
define("VA_BASE_PATH", dirname(__FILE__));
set_include_path(implode(PATH_SEPARATOR, array(
realpath(VA_BASE_PATH . '/AbstractLayer/'),
realpath(VA_BASE_PATH),
realpath(VA_BASE_PATH . '/../'),
realpath(VA_BASE_PATH . '/../Core'),
get_include_path(),
)));
function vaDaemon_Autoloader($class_name)
{
$class_name = str_replace('\\', '/', $class_name);
$class_name = str_replace('_', '/', $class_name);
require_once "$class_name.php"; // **line 37 as mentioned above in error**
}
spl_autoload_register('vaDaemon_Autoloader');
function pathify($class_name) {
return str_replace("_", "/", $class_name) . ".php";
}