skip to Main Content

I am getting the following warning and error on a plesk server where I am trying to get the Zend framework working:

PHP Warning: require_once(Zend/Loader.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/vhosts/mydomain.com/httpdocs/test.php on line 5 
PHP Fatal error: require_once() [function.require-once]: Failed opening required 'Zend/Loader.php' (include_path='.:/usr/share/pear:/local/PEAR/:/usr/share/zend') in /var/www/vhosts/mydomain.com/httpdocs/test.php on line 5

I have set the include_path in the php.ini file (/etc/php.ini) to use the directory where I have added the Zend files (/usr/share/zend). This directory then has the framework in a sub-dir called Zend.

I have tried adding a slash to the end of the include_path (/usr/share/zend/).

The path is present when I use get_include_path()

I have tried using set_include_path.

The /usr/share/zend directory has 775 permissions (also tried with 777) and the user and group are both set to root.

I would like to have the framework available to all sites on the server.

I have copied in the Gdata files too and the Zend/Loader.php is there.

Versions:

  • Framework: 2.0.4
  • Gdata: 1.12.0

This is the PHP:

require_once("Zend/Loader.php");

I have also tried using:

require_once("/usr/share/zend/Zend/Loader.php");

I am novice plesk/unix user

2

Answers


  1. The things to check for are:

    • The file exists where PHP is looking for it.
    • The file is readable by the web server/php_fpm process.
    • safe_mode is off!

    (Putting the information here – so that the question can be marked as answered!)

    Login or Signup to reply.
  2. Zend/Loader.php is for ZF1 and that file don’t exists with ZF2 (2.0.4)

    Also you need to download the updated version of GData compatible with ZF2

    https://github.com/zendframework/ZendGData

    If you’ll use Composer to setup your dependencies then you should use require_once __DIR__ . '/path/to/vendor/autoload.php

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search