Jump to content

[SOLVED] Problem with Zend and include path


adamsargant

Recommended Posts

I've placed the Zend library folder at

 

/usr/lib/php

 

and set my include path (actually, I've tried both in the php.ini file and with the set_include_path() command)

 

/usr/lib/php/Zend/Loader.php is definitely present, but running the following

 

echo get_include_path()."<br />";
set_include_path(".:/usr/lib/php/library");
echo get_include_path()."<br />";
require_once 'Zend/Loader.php';

 

gives me

 

.:/usr/share/pear:/usr/share/php

.:/usr/lib/php/library

 

Warning: require_once(Zend/Loader.php) [function.require-once]: failed to open stream: No such file or directory in /home/default/intelligent-income.com/user/htdocs/testinclude.php on line 15

 

Fatal error: require_once() [function.require]: Failed opening required 'Zend/Loader.php' (include_path='.:/usr/lib/php/library') in /home/default/intelligent-income.com/user/htdocs/testinclude.php on line 15

 

I'm wracking my late night brains with this one? any help would be greatly appreciated.

 

Adam

Link to comment
Share on other sites

Did you use /usr/lib/php/library/Zend/Loader.php when you checked to see if the file was there?  I just want to rule out the simple explanations first :)

 

If the file really is there, the next thing I would try is putting a file directly in /usr/lib/php/library and including that.

 

Next step would be adding the new include path onto the existing include path instead of replacing it altogether.  Maybe that will help for some reason.

Link to comment
Share on other sites

Did you use /usr/lib/php/library/Zend/Loader.php when you checked to see if the file was there?  I just want to rule out the simple explanations first :)

 

Absolutely... first check its all plugged in  :D I do appreciate the time

 

I did indeed check that the file Loader.php was present in the  /usr/lib/php/library/Zend directory

 

If the file really is there, the next thing I would try is putting a file directly in /usr/lib/php/library and including that.

 

OK, I created a file testincludepath.php and placed it in the library folder

 

Now when I run

 

echo get_include_path()."<br />";
set_include_path(".:/usr/lib/php/library");
echo get_include_path()."<br />";
require_once 'testincludepath.php';

 

I get

 

.:/usr/share/pear:/usr/share/php

.:/usr/lib/php/library

 

Warning: require_once(testincludepath.php) [function.require-once]: failed to open stream: No such file or directory in /home/default/intelligent-income.com/user/htdocs/testinclude.php on line 15

 

Fatal error: require_once() [function.require]: Failed opening required 'testincludepath.php' (include_path='.:/usr/lib/php/library') in /home/default/intelligent-income.com/user/htdocs/testinclude.php on line 15

 

which is consistent with my previous experience  >:(

 

Next step would be adding the new include path onto the existing include path instead of replacing it altogether.  Maybe that will help for some reason.

 

The existing include path seems to be a php default as the path in php.ini is commented out, however, setting the path there rather than with set_include_path() gives exactly the same error as above... the path is clearly set when I echo get_include_path(), but it ain't working... arrghh  >:(

 

Link to comment
Share on other sites

OK replying to self, but got to the bottom of the problem

 

When a domain is set up on my server, the vhost.conf file entry includes the line

 

php_admin_value open_basedir /tmp:/home/default/mynewdomain.com

 

limiting the files that can be opened to those in /tmp and  above domain root

 

Spotted when I looked at phpinfo.php... commenting the line out solves the problem, though <ponders> wonder if would be better sticking path in php_admin_value open_basedir? </ponder>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.