Wednesday, November 11, 2015

Failed to load Zend/Loader.php - Easy permanent solution

I encountered this error message today:

"Failed to load Zend/Loader.php"

-or some people also experienced -

"Failed to load Zend/AutoLoader.php"

What caused the issues above?  Basically a script somewhere in your PHP app is requiring Zend Framework Library, and it can not find it.

This is how I solved this issue:

1. Install Zend framework library (if it does not already exists).
   
    for Ubuntu > 9.04 use:   apt-get install zend-framework

    The above command will install Zend Framework in /usr/share/php

2.  Then you should create .ini file for PHP to include your newly install Zend extension

     nano /etc/php5/conf.d/zend-framework.ini

with the following content:

[Zend]
include_path=${include_path} ":/usr/share/php/libzend-framework-php"

3.  Restart your webserver.
   
     service apache2 restart

Your error message should now disappear.

I hope this helps someone.