Zend Framework Error: Opening failure required "Zend / Application.php"

I get the following error when trying to start a project created by Zend Framework. It searches for Zend / Application.php and is available in the directory which is in my include_path. I have read permissions in the directory.

PHP Fatal error: require_once () [function.require]: Failed to open the window "Zend / Application.php" (Include_path = '/ var / www / virtual domains / moderncloud.net / ohm / library:.: / Var / www / virtual domains / moderncloud.net / ohm / 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(); 

DECISION:

I found it today. Its a problem with the "php_admin_value open_basedir" option in my httpd configuration. I installed it no, and it started working. Alternatively, I think I can add the Zend library directory to the open_basedir parameter in my web server configuration, and not to install it.

+4
source share
3 answers

Can you try replacing:

  set_include_path (implode (PATH_SEPARATOR, array (
     ('/var/www/vhosts/moderncloud.net/om/library'),
     get_include_path (),
 )));

with

  $ siteRootDir = dirname ($ _ SERVER ['DOCUMENT_ROOT']);

 set_include_path (
     $ siteRootDir.  '/ library'.  PATH_SEPARATOR 
     .  $ siteRootDir.  '/ application'.  PATH_SEPARATOR 
     .  get_include_path ()
 );

Hope this works for you.

0
source

If possible, remove the existing zend framework and install ZF using PEAR. It will be easier to update later:

  pear channel-discover zend.googlecode.com/svn pear install zend/zend 

It will also use PEAR include_path, so it should solve your problem.

If you cannot use a pear, try using a relative path with your include path:

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

This issue occurs because of:

  • Inside the shared folder in the index.php file.

or

  1. Internal folder of the library: - Just register in the library folder, there is a Zend folder present in the library folder or not. If the zend folder is missing, then download from the zend frame and save it in the 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(); 
0
source

Source: https://habr.com/ru/post/1381985/


All Articles