2

Using Lampp in Ubuntu, I set the include_path of my php.ini to "/usr/share/php/libzend-framework-php" for me to get to zend library.

But when I use it in a code, like say:

require_once "Zend/Loader/Autoloader.php";

I'm getting an error- "failed to open stream: No such file or directory". I'm totally lost. I don't know why my script aren't getting the file when it is actually there.

Majinbibo
  • 159
  • 5
  • 17

1 Answers1

0

According to http://packages.ubuntu.com/natty/all/libzend-framework-php/filelist, the file in question might be called "Autoloader.php", not "Autoload.php".

The ZF documentation appears to back this up:
http://framework.zend.com/manual/en/zend.loader.autoloader.html

  • Dang; and I was getting all excited, too. If you `head /usr/share/php/libzend-framework-php/Zend/Loader/Autoloader.php`, does it find the file? –  May 19 '11 at 02:59
  • 1
    What about, is PHP actually using the include_path value? If you `echo get_include_path()`, are you seeing the expected value? Is this a CLI or an Apache application? If Apache, have you restarted apache after making changes to php.ini? –  May 19 '11 at 03:03
  • woah! it prints ".:/usr/share/php:/usr/share/pear". I don't understand. But when I check my php.ini file in xampp, the value of 'include_path' is '/usr/share/php/libzend-framework-php' – Majinbibo May 19 '11 at 03:06
  • 1
    Check your phpinfo page for the `Loaded Configuration File` value and make sure you put the change in the correct file. There's also a `Additional .ini files parsed` entry; maybe a subsequently-loaded .ini file is overriding it. When you got the weird result, were you using CLI or loading the page in a browser? –  May 19 '11 at 03:10
  • .htaccess files can also modify the value of include_path: http://php.net/configuration.changes –  May 19 '11 at 03:11
  • Saw it. Thanks @Phoenix! The ini file that my apache is loading is in /etc/php5/cli but I don't get it. Why my lampp is using that ini file when he has his own? – Majinbibo May 19 '11 at 03:17
  • Interesting. I wonder if there's a second installation of Apache (and possibly PHP) on your system. Try checking the output of `dpkg --get-selections` and see if there's an existing install (see http://www.howtogeek.com/howto/linux/show-the-list-of-installed-packages-on-ubuntu-or-debian/ for more info). –  May 19 '11 at 03:24
  • There is now a troubleshooting checklist for this frequent error here : http://stackoverflow.com/a/36577021/2873507 – Vic Seedoubleyew Apr 12 '16 at 15:25