I have a webserver running CentOS 6. Yesterday, I installed php-gd with yum install php-gd because I couldn't see graphics on my website. However, when I see my php version, it changed from 5.3 to 5.4x.

Because my application uses register_globals (which was removed from php 5.4), I cant even log in to my app.

I tried two ways to downgrade my php:

  1. Using yum again to downgrade; this wouldn't downgrade to 5.3x, just 5.4x
  2. Downloading the php rpm directly; I messed this up, and wound up with dependency hell.

Why not simply fix your code - According to http://ubuntuforums.org/showthread.php?t=1973028 add the following to the top of your PHP script -

foreach ($_REQUEST as $key=>$val) { ${$key}=$val; }

(And ask yourself why you are running insecure code).

Apparently you can even automate this further by adding an "auto_prepend_file" directive to a .htaccess file to make it work for the entire directory in 1 hit.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.