php version via .htaccess

Discussion in 'Linux VPS/Dedicated - General' started by Denzla, Jun 15, 2017.

  1. Denzla

    Denzla New Member

    Hello,
    I would like to know the correct way to add handler in .htaccess to switch php version.
    Thank you
     
  2. phpAddict

    phpAddict Active Member

    If you have EasyApache 4 active you should have a MultiPHP manager available in WHM which allows you to change PHP versions per account. No htaccess configuration needed. However, EasyApache 4 only supports 5.5, 5.6 and 7.0 (some others too depending on your configuration), if you need a different version you'd have to upgrade to CloudLinux or do some unsupported customizing outside of cpanel.

    Why is it you need a different version?
     
  3. Denzla

    Denzla New Member

    My server is 5.3 and i need higher version for my Laravel app, however i do not have admin access to the server. Tried to add handlers via .htaccess files and they got recognized in cpanel but php scripts are downloaded not executed. I guess higher versions are not installed on the server but i thought to ask just in case.
    Thank you for answering
     
  4. phpAddict

    phpAddict Active Member

    Unless it's configured on the server, you won't be able to change the PHP version from within just a cPanel account, you'll need root access. If you're not the administrator of the server, just ask whoever is, they should be able to help you. There's no reason you should be stuck back on version 5.3. If you're on 5.3 the server is likely using EasyApache 3 which easily allows upgrading to as high as 5.6 without heavily affecting most applications. Your administrator should be able to easily upgrade the server to 5.6 which is what Larvel requires. Your administrator will need to upgrade to EasyApache 4 by January 2018 anyway so they may as well get started now.
     
    Denzla likes this.
  5. Denzla

    Denzla New Member

    Yes I already asked my admin.
    Thank you very much.
     

Share This Page