Video: How to change PHP version for addon domain

  1. During the video, we share the following code that should be added to the '.htaccess' file content:

    <FilesMatch ".(?:html|php)$">
    SetHandler application/x-lsphpXX

    The XX in the code is the PHP version you wish to set. It can be any of these: 52, 53, 54, 55, 56, 70, 71,72, or, 73.

  2. When a different PHP version is set for an addon domain, there are no PHP extensions enabled by default. You can run this command via SSH to ensure your website work correctly:

    cp /opt/alt/default_php_ini/phpXX.ini /home/cPanel_username/path_to_the_folder/php.ini

    • XX is the PHP version you wish to set (it can be 52, 53, 54, 55, 56, 70, 71, 72 or 73)
    • cPanel_username should be replaced with your actual cPanel username
    • path_to_the_folder is a path to the folder of the addon domain
Find more Namecheap Knowledgebase How-To demos on YouTube. Do not forget to subscribe to our channel!
4781 times

Need help? We're always here for you.