You are here: PHP4 -> PHP5: require does not check file directory anymore? « All PHP « IT news, forums, messages
PHP4 -> PHP5: require does not check file directory anymore?

Posted by Markus Ernst on 02/15/06 14:48

Hi

In my application I have lots of require statements that include files
residing in the same directory:

index.php requires:
require_once($_SERVER['DOCUMENT_ROOT']."/modules/cms/classes/page.php");

page.php requires:
require_once("common_functions.php");

Now I try to install the application on a PHP5 server (Apache), and this
does not work anymore.

In the PHP4 -> PHP5 migration chapter of the manual I did not find any
notes on a change of the require/include behaviour, not checking the
directory of the calling file anymore; nor did I find it googling. So I
am not sure if it is an undocumented migration issue or just a setting.

I understand that I can use:
require_once(dirname(__FILE__)."/common_functions.php");

But this means rewriting the whole application. Is there a way to change
this behaviour via ini_set()? (As I am in a shared hosting environment I
have no direct access to the php.ini.)

Thanks for hints
Markus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация