path behaviour not working as expected

I've just moved a load of sites to a new VPS and have a strange problem with include_path. It's something that worked fine on the old server but not on the new.

I'll try and explain it using a simple example...

In /home/kin/www/lib/Zend and also in /home/kin/www/ipb/_membadmin/Zend there is a file called test1.php which simply echoes which folder it is in.

In /home/kin/www/ipb/_membadmin there is a file called test.php It has one line....

require_once 'Zend/test1.php';

When you run it, as you would expect, it echoes the line from test1.php in /home/kin/www/ipb/_membadmin/Zend

If you then rename /home/kin/www/ipb/_membadmin/Zend to something else (so the 'include' statement can't find it), and run test.php again, it SHOULD (I think) echo the file in /home/kin/www/lib/Zend because php include_path is set to include /home/kin/public_html/lib (which phpinfo.php confirms). ... but it doesn't.

Why not? If there is an include path of /home/kin/public_html/lib then surely

require_once 'Zend/test1.php';

should point to /home/kin/www/lib/Zend . It does on the old server!

I must be missing something obvious but I don't know what!

Any thoughts? Thanks


After the diagnostic you just gave it now seems clear that something is overriding the environment path.

There has to be some line in your code where the set_include_path is getting called. Is any Zend specific code running that you haven't checked? That missing directory clearly paints the culprit as a rogue set_include_path()

链接地址: http://www.djcxy.com/p/57950.html

上一篇: rawurlencode()的奇怪行为...如何让它工作?

下一篇: 路径行为不按预期工作