Upgraded a server to PHP 5 from PHP 4


Everything went pretty smooth while upgrading a server for a customer. I was moving them from Fedora Core 3 to Fedora Core 4. This also meant that PHP 5 was installed instead of PHP 4, and MySQL 4.1 was installed instead of MySQL 3.23. All was working smoothly except one of the websites on the server was having some major issues. The pages would not display, and $HTTP_POST_VARS and $HTTP_GET_VARS were not working correct.

I did not design the site, so I was not familiar with how the $_POST and $_GET were used within the code. After opening the files I quickly saw the problem. In the PHP.ini there is a new setting that, by default, only looks for the short forms of these predefined variables. In other words, it doesn’t know what $HTTP_POST_VARS or $HTTP_GET_VARS are. But it recognizes $_POST and $_GET with no problem.

After changing the setting in the PHP.ini all is working fine. Luckily the previous programmer did an ‘ok’ job.

The setting in the PHP.ini that needs to change is:

register_long_arrays = Off

This is located in the “Data Handling” section about 1/3rd of the way down the file. (If you followed the default installation of Fedora Core 4.)