PHP upgrade to v.5.3 breaks includes?

I was asked to fix a site that was fine just days ago and now is not able to include files due to the host's upgrade of the PHP to v.5.3

For each include I now get two Warnings, like this:

Warning: include_once(file.php) [function.include-once]: failed to open stream: No such file or directory in /home/content/anotherFile.inc.php on line 2

Warning: include_once() [function.include]: Failed opening 'file.php' for inclusion (include_path='.:/usr/local/php5_3/lib/php') in /home/content/anotherFile.inc.php on line 2

I don't really want to rewrite the site. Is there a way to fix the path? It is on a shared hosting and I am not able to modify php.ini

I searched quickly and it appears an issue with PHP 5.3, which goes away with 5.3.1... Bug?

What are the possible solutions?


UPDATE: I think the issue is with the code. It was written years ago and $_GET values were used as $value. Changing to $_GET['value'] seem to have fixed a few issues.


It seems the problem is caused by a deprecated php.ini setting: register_globals = on .

That would cause your $GET variables to get extracted and be globally available like you described in your edit.

In php 5.3 this setting is deprecated but not yet removed, so while you are refactoring, you can turn it back on again so that your site is working again. However , note that you do need to get rid of this setting as it is a security risk and it has been completely removed in php 5.4

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

上一篇: 打包LAMP应用程序以便于部署

下一篇: PHP升级到v.5.3的突破包括?