Knowledgebase: Technical Issues > Scripts
Running legacy PHP scripts
Posted by , Last modified by David Suker on 22 November 2019 02:57 PM

While we highly recommend against running older versions of PHP under any circumstances, in that rare case when you want to run legacy scripts that require old PHP version (5.3 being the oldest at the moment), you can do the following:

  • Find and open (or create if it doesn't exist) file named .htaccess in document root folder. It usually resides in ~/public_html directory, but may be located in a sub-directory, in which case you'll be running legacy PHP version for that subdirectory only.
  • Insert the following code somewhere at the top of .htaccess in order to select PHP 5.3:
    <FilesMatch \.(phtml|php[543]?)$>
    SetHandler application/x-httpd-php53
    </FilesMatch>
  • Save the file and test the code. You might want to create a test PHP script with contents "<? phpinfo() ?>" to see information about current interpreter.

 

(7 vote(s))
Helpful
Not helpful

Comments (0)