1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

How to downgrade PHP 5 to PHP 4

Discussion in 'Plesk for Linux - 8.x and Older' started by lboria, Jul 12, 2006.

  1. lboria

    lboria Guest

    0
     
    Can someone help with the best way possible to downgrade our Plesk 8 running PHP 5 to PHP 4 about 90% of our sites has scripts that require this version of PHP.

    Please give detail steps.... thanks
     
  2. lboria

    lboria Guest

    0
     
  3. kenped

    kenped Guest

    0
     
    I'm not a plesk guru or linux, but i do php programming,,

    I would basicly look for the config file of php .. I would install php as a package ,, then edit the main config file to load the module

    LoadModule php4_module modules/libphp4.so

    something like that: I would also check the AddType to make sure that the file extensions to be loaded reflects php4.

    But hey again DONT TAKE IT TO THE BANK :) just a suggestion

    -ken
     
  4. perfectpenguin

    perfectpenguin Guest

    0
     
    It's maybe not as bad as it seems...

    Hi, Just my take on this for anyone that's stopping by here. I too was searching for info on this having just been forced to upgrade our server following a hack. A lot of our sites we're broke following the upgrade which I blamed largely on incompatibility with PHP5.

    However, for anyone in the same position, I'd first suggest doing the following and then seeing how many issues are fixed:

    1. Make sure you have PHP_SAFE_MODE OFF in plesk, at domain level (if the site is not causing you a problem, leave it on, though)

    2. Edit your php.ini, look for 'register_long_arrarys' and set it to on. This gives you backwards compatibility with the old $HTTP_*_VARS which no longer exist in PHP5.

    Finally, if you're still getting odd stuff or just blank screens, dig into /var/www/vhosts/domain.name/statistics/logs/error_log and get some hints from there.

    This has ireoned out 90% of my problems - I hope it can do the same for you.

    Cheers,

    Simon

    UPDATE:
    After making any of the above changes, don't forget to restart apache.

    Also, other stuff I found that PHP5 doesn't like which was previously fine in PHP4:
    1. Declaring a variable name more than once in a class (sometimes just a genuine mistake by the developer - check your error logs).

    2. including and/or requiring files: seems to be a very random problem but sometimes files which are well within the open_basedir restrictions just will not include - the error logs will hint to this if it happens. Good work around if all else fails:

    PHP:
    <?php include($_SERVER['DOCUMENT_ROOT'].'/path/to/file/from/httpdocs/includename.php'); ?>
     
Loading...