Allan Brown

October 15, 2009

include_path setting can cause problems in Magento

Filed under: Magento — Tags: , , , , , — Allan Brown @ 1:24 am

I had a small problem today with the Magento connect application. All other Magento functions were working, but when I tried to access Connect (http://sitedomain.com/index.php/admin/extensions_local/), a load of errors were being displayed saying:

Warning: include_once(Maged/Model.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/web1/html/downloader/Maged/Controller.php on line 21

Warning: include_once() [function.include]: Failed opening ‘Maged/Model.php’ for inclusion (include_path=’/usr/share/pear:/usr/share/php’) in /var/www/web1/html/downloader/Maged/Controller.php on line 21

Warning: include_once(Maged/View.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/web1/html/downloader/Maged/Controller.php on line 22

Warning: include_once() [function.include]: Failed opening ‘Maged/View.php’ for inclusion (include_path=’/usr/share/pear:/usr/share/php’) in /var/www/web1/html/downloader/Maged/Controller.php on line 22

Warning: include_once(Maged/Exception.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/web1/html/downloader/Maged/Controller.php on line 23

Warning: Cannot modify header information - headers already sent by (output started at /var/www/web1/html/downloader/Maged/Controller.php:21) in /var/www/web1/html/downloader/Maged/Controller.php on line 311

After much searching, I discovered that it was due to an incorrectly set ‘include_path’ in the apache php.ini file. We are using some advanced caching on the server to speed things up, and the setting it was changed to was slightly out.

So, we changed it from

/opt/coolstack/php5/lib/php/

to

.:/opt/coolstack/php5/lib/php/

However in most cases, it would be:

on Linux: include_path = “.:/php/includes”
on Windows: include_path = “.;c:\php\includes”

A quick Apache restart and all is well again. Easy fix!

Get Adobe Flash playerPlugin by wpburn.com wordpress themes

Powered by WordPress