Zend 框架错误:无法打开需要“Zend/Application.php" [英] Zend Framework Error: Failed opening required 'Zend/Application.php'

查看:28
本文介绍了Zend 框架错误:无法打开需要“Zend/Application.php"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试运行由 Zend Framework 创建的项目时,出现以下错误.它正在寻找 Zend/Application.php,它在我的 include_path 目录中可用.我确实拥有该目录的读取权限.

<块引用>

PHP 致命错误:require_once() [function.require]:无法打开所需的Zend/Application.php"(include_path='/var/www/vhosts/moderncloud.net/om/library:.:/var/www/vhosts/moderncloud.net/om/library:') 在/var/www/vhosts/moderncloud.net/om/public/index.php 上第 24 行

bootstrap()->运行();

解决方案:

<块引用>

我今天自己找到的.它的选项有问题我的 httpd 配置中的php_admin_value open_basedir".我设置为没有,它开始工作.或者,我想我可以附加 Zend 库将目录添加到我的 Web 服务器配置中的 open_basedir 选项,而不是将其设置为 none.

解决方案

这个问题产生的原因:

  1. 在 index.php 文件中的 Public 文件夹内.

  1. 在库文件夹中:- 只需检查库文件夹,库文件夹中是否存在 Zend 文件夹.如果不存在 zend 文件夹,则从 zend 框架下载并保存在库文件夹中.

<块引用>

=> 在 index.php 中复制以下代码并替换它.

bootstrap()->运行();

I get the following error when I try to run the project created by Zend Framework. Its looking for Zend/Application.php and that is available in the directory that is in my include_path. I do have read permissions on the directory.

PHP Fatal error: require_once() [function.require]: Failed opening required 'Zend/Application.php' (include_path='/var/www/vhosts/moderncloud.net/om/library:.:/var/www/vhosts/moderncloud.net/om /library:') in /var/www/vhosts/moderncloud.net/om/public/index.php on line 24

<?php


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

defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', dirname(__FILE__) . '/../application');

// 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(
    ('/var/www/vhosts/moderncloud.net/om/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();

SOLUTION:

I found it myself today. Its a problem with the option "php_admin_value open_basedir" in my httpd configuration. I set it to none and it started working. Alternatively, I guess I can append the Zend library directory to the open_basedir option in my web server configuration instead of setting it to none.

解决方案

This problem generated due to :

  1. Inside Public folder in index.php file.

or

  1. Inside library folder :- Just check in library folder there is a folder of Zend present in library folder or not.If not present zend folder then download from zend framework and save in library folder.

=> In index.php copy the following code and replace it.

<?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') : 'production'));  

 // 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';
  require_once 'library/Zend/Application.php';




  // Create application, bootstrap, and run
 $application = new Zend_Application(
 APPLICATION_ENV,
 APPLICATION_PATH . '/configs/application.ini'
      );
                                                                                                                                                                                                                     $application->bootstrap()
        ->run();

这篇关于Zend 框架错误:无法打开需要“Zend/Application.php"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆