Deprecated warnings in PHP5

If you've recently moved servers from a server where PHP4 was the default to a server where PHP5 is now the default you may be seeing lots of warnings about deprecated functions...

PHP5 is considered a major upgrade to PHP4, and as part of PHP5 they have deprecated many old functions. When a function is deprecated it continues to work for now (but produces a warning in your screen output to tell you that the function is deprecated) but will be removed from the PHP language at some point the near future.

You have two options in this scenario, one we recommend and one we don't!

  1. We recommend, upgrading your shopping cart / forum / blog / script to a version that is compatible with PHP5.
  2. The alternative is to use a line in your .htaccess to fall back to PHP4 for the time being. We don't recommend this because it is putting off the inevitable and at some point PHP4 will be removed and you'll be left with no script at all!

As a temporary measure you could use this line in .htaccess (in your public_html folder) to get you up and running today, with a view to upgrading at the earliest possible convenience your scripts. The line you need to add is:

    AddHandler application/x-httpd-php4 .php

This is another reason to keep your scripts updated at all times!

Was this answer helpful?

 Print this Article

Also Read

Increasing upload_max_filesize

If you are using a CMS you may have found that you can't upload larger files because of the...

Turning magic quotes off

A lot of software now is requiring that "magic quotes" be switched off as it presents a security...

PHP4 and PHP5

When we made the decision to install PHP5 we were made aware of a large number of scripts that...

Processing HTML files with PHP

If you want to add PHP commands to your HTML pages and don't wish to change the file extensions...