Changing your PHP Version in cPanel

Our newest servers give you the option to run different versions of PHP (7.0, 5.3, 5.4) on your account. This is important when using third party applications that require the latest stable version of PHP. The PHP version can only be changed on shared servers and this functionality is available by default to all shared cPanel hosting customers who are on servers that use PHP 5.3. (Not currently a customer? Now’s the time to make the switch to our shared cPanel hosting!)

If you are a VPS or Dedicated customer, to take advantage of running PHP 5.4 you must be currently using PHP 5.3 and MySQL 5.1 – if you are not using these minimum requirements you must upgrade first. Please contact our support department if you are a VPS or dedicated hosting customer and wish to use PHP 5.4.

Please keep in mind, PHP 5.4 has it’s own web server built into it. We have disabled this functionality as it conflicts with our servers configuration. 

Changing the PHP Version:

  1. Log into cPanel
  2. Click PHP Configuration in the Software section.
    Older servers will not display this option, however you can request to be moved to a newer server that has this ability by submitting an email to support@inmotionhosting.com. Please verify your account in the email by providing your current AMP password or the last four digits of the credit card on file.

  3. Select the version of PHP you want to use from the dropdown.

  4. Click Update to save your php configuration.
  5. Check your changes by viewing your settings in a phpinfo page.

Congratulations, you adjusted your PHP version in cPanel. If you need to setup your account to use multiple PHP versions, see the article on using multiple PHP versions on one account.

Thoughts on “Changing your PHP Version in cPanel

    • It depends on your specific site and how it was built. You can try as a test, then switch back if it causes issues. Another option is to have your website Developers review your site to ensure it is compatible.
      Thank you,
      John-Paul

  • What are looking for in the php/apache logs and how do we know what setting to use for .htaccess? Also, where are these logs?

    • The PHP logs are generally in the root of your website files, but it may also depend on the application you are using. The settings used in .htaccess depends on the application you’re trying to use. If you use the cPanel’s switcher for PHP, you don’t have add code in your .htaccess file for the PHP version.

      The Apache log is not available to you unless you have root access with a VPS or dedicated server account. If you have neither, then you will need to contact our live technical support team.

    • Some website can run on various PHP versions. However, in order to know for sure, you should check with the documentation for the software you used to build/maintain your website. As long as the PHP version you want to use is supported, then you shouldn’t experience issues with your website for changing the version.

  • Hi guys, i need help with my version of php i need update to greater than 5.5 version but i can’t do it from my cpanel. There is no option to do that, what can i do?

    • If you don’t see the option to do it in cPanel, then you contact our live technical support team. They should be able to add the option in your cpanel so that you can switch it as needed. The live tech support team contact info is at the bottom of this page.

  • Hi Guys, 

    I just updated our Php version today usingthe provided imagesand steps above and it causes our website to display this.

    Error 500 – Internal Server Error

     

    An error was encountered while processing your request. Typically this is a temporary condition. Please contact the web site owner for further assistance.

    Any idead how to fix this.? 

    • The most common cause of this when upgrading the PHP version is having invalid PHP values defined in the .htaccess file, permissions, or the website not being compatible with the version of PHP the site has been changed to. I would recommend reviewing your Apache and PHP error logs to get more information about why it is showing the error.

  • hello dear friend i need for help i upload my desgin of website in new cpanel but the new cpanel is new version i change virsion from cpanel some old version but not solved my problem please help me this is my website http://www.ayil.af

     

    how can change php version from sorces cod of php

     

    this is from old cpanel .htaccess

     

    RewriteEngine on

     

    RewriteCond $1 !^(index\.php|nayil|bootstrap|images|frontend|js|user_guide|css|fonts|vendors|froala|assets|media|robots\.txt)

     

     

    RewriteRule ^(.*)$ /index.php/$1 [L]

     

    and

     

    php.ini

     

    ini_set(‘extension’, ‘php_fileinfo.so’);

     

    but now i can’t work in new version of new cpanel 

  • Hi,

     

    is there any option to multiple Php versions at a time

    Ihave a application that support only php 5.3  and another one i want to use is 5.4 above

    what should in such cases?

  • Thank you for this support!  I just updated my PHP to the minimum update of 5.6 – I am not a coder, so I’m ignorant as all heck. How can I confirm that my pages (site) is correctly updated to avoid crashing when the system udpates on August 7th?  Once I can idenify how to confirm my site is fully updated, and working, I will move foward fully updating the PHP. 

    PS – I’ve gone into my PHP files and opened them, but I don’t see any indication that would identify to me what type of PHP has been applied. 

    • PHP is applied account or sometimes site wide and not into the specific files themselves. If you updated php in cPanel to a newer version you should be fine. I’d suggest adding a php info page so you can see what version of PHP you are actually running.

    • Hello Karen,

      It will only interrupt visitors if the change affects the way your site operates. If the change does not affect the code of your site, then it should be transparent to the user.

      If you have any further questions or comments, please let us know.

      Regards,
      Arnel C.

  • Hi.

    I was able to change my PHP version without any problem but this hasn’t change the system PHP version. Is it normal? Will it have some impact to me?

    Thanks’

    • Your system has multiple PHP versions available. The PHP Switcher only changes the PHP version running on your specific account.

      Thank you,
      John-Paul

  • Tim Sisson, Thank you! This worked perfectly ^_^ and for those of you that updated your PHP and your site still doesn’t work? Try just changing the update version. I thought mine updated to the last update, 7, but no, I had to “update” to version 5.3 for mine to work. 

    • If you have a VPS/Dedicated account you will not have the same PHP Configuration option in your cPanel. But you can change your PHP version manually in a number of different ways. Or, you can contact our live support to help you. We can install the “PHP Switcher” (as seen above) in your cPanel, also through a verified support contact request.

  • hi

    i was using new version of php.but my live server is using old version.in live server it doesnt work.shows an error. can any one help

  • Yes it does work when i use php version 5.3 or 5.3.  it doesn’t work when i use php version 5.4 5.5 5.6. moreover I am an customer on inmotionhosting.com. I would like to get some helpf from you. can i talk you through email?   by the way  this is my domain information. glassman.co.kr  

  • Hi, when i upgrade the php version higher than 5.3,  my wordpress woocommerce plugin and pages are not working. 

    These are the error messages:

    [Fri Nov 20 09:42:12.858296 2015] [:error] [pid 23101:tid 140133080975104] [client 216.54.31.82:50819] Failed loading /opt/php55/lib/php/extensions/no-debug-non-zts-20121212/:  /opt/php55/lib/php/extensions/no-debug-non-zts-20121212/: cannot read file data: Is a directory

    [Fri Nov 20 09:42:12.858489 2015] [:error] [pid 23101:tid 140133080975104] [client 216.54.31.82:50819] Failed loading /opt/php55/lib/php/extensions/no-debug-non-zts-20121212/ZendGuardLoader.so:  /opt/php55/lib/php/extensions/no-debug-non-zts-20121212/ZendGuardLoader.so: cannot open shared object file: No such file or directory

    How can i solve this issue? 

     

    My wordpress and woocommerce and theme version are the newest one. i updated all of them. 

    • Hello Tate,

      Sorry for the problem with Woocommerce and WordPress. Are you saying that your installation works with the earlier version of PHP? Have you tried to use the default server php.ini file (comment out your current PHP.INI – by default the server one should load)? It appears that you’re getting an error on loading the ZenGuardLoader.so because it can’t be found. That file is generally on our servers – its path is defined in the PHP.INI file. If it’s unable to find it based on a different PHP.INI then it will fail with this error. If you are an InMotion customer, can you provide the domain name? We can investigate it in more depth if you provide a URL or account information.

      I hope this helps to answer your question, please let us know if you require any further assistance.

      Regards,
      Arnel C.

  • hello edens,
     thanks for your reply.
     
     
    these links are showing blank pages on every new 2nd hour.
    1st hour its working and 2nd hour its not working.
    3rd hour its working and 4th hour its not working.
    its like a loop.
     
     
     
    these links are working always every hour.
     
     
    thanks again for your timing.
    • Shawn,

      I’m sorry that your site is not working under the changing PHP version conditions. We do not understand what you’re trying to accomplish by switching on an hourly basis. We recommend that you stick with ONE version of PHP and make ALL of your code work in that version. Additionally, PHP does deprecate and eventually remove commands based on version. So, it’s possible that the problem you’re seeing may be related the difference in versions. The coding to resolve this issue may require a developer/programmer, but that issue is beyond our scope of support. We do apologize if this is not a satisfactory answer for you, but typically if a page or two isn’t working, while others are at a certain point in time, then it points to the code on the page.

      Kindest regards,
      Arnel C.

  • hy scott,

         thanks for your reply.

    dear my site working well untill i add more than 10 website in my site

    allhyipinvestor.com

     

    if i add less than 10 website in my site.

    then my site always working well and active.

     

    if i add more than 10 websites then my site on and off hourly basis.

    1 hour working well and active .

    2nd hour blank white page show.

    3rd hour working well and active .

    4nd hour blank white page show.

    and so on its like a look.

    i make it active manually by changing php version or add this code in .htaccess file.

    AddHandler application/x-httpd-php52  .php52 .php

     

    1st hour i add this coding in .htaccess file 

    and second hour i need to remove that coding for active my site.

    its like a loop also.

     

    so thats why i am asking for condition.

     

    if new hour start then 

    or 

    if website in off then

     

    RewriteEngine on

    #RewriteBase /

    RewriteCond %{REQUEST_FILENAME} -f [OR]

    RewriteCond %{REQUEST_FILENAME} -d

    RewriteRule ^.*$ – [NC,L]

    RewriteRule .* index.php [L]

     

     

    else

     

    RewriteEngine on

    #RewriteBase /

    RewriteCond %{REQUEST_FILENAME} -f [OR]

    RewriteCond %{REQUEST_FILENAME} -d

    RewriteRule ^.*$ – [NC,L]

    RewriteRule .* index.php [L]

     AddHandler application/x-httpd-php52  .php52 .php

     

     kindly chat with me for further i am online

    allhyipinvestor.com.

    hyipinvestor@yahoo.com  

     

    • Hello Shawn Roy,

      Can you provide us a url that is currently giving a blank page so we can take a look into the problem? Apache will either work not with what you have configured, it does not change over time.

      Best Regards,
      TJ Edens

  • hello friends,

           i want to change my php version automatically on every hour by .htaccess file.

    1st hour i want 5.3

    2nd hour i want 5.4

    3rd hour i want 5.3 

    4th hour i want 5.4

     

    any master can make the coding for my .htaccess file. or you have any solution for this.

    you can use else,if statement also in this coding.

    this is my .htaccess coding.

     

    if new hour start then

     

    RewriteEngine on

    #RewriteBase /

     

    RewriteCond %{REQUEST_FILENAME} -f [OR]

    RewriteCond %{REQUEST_FILENAME} -d

    RewriteRule ^.*$ – [NC,L]

    RewriteRule .* index.php [L]

     

     

    else

     

    RewriteEngine on

    #RewriteBase /

     

    RewriteCond %{REQUEST_FILENAME} -f [OR]

    RewriteCond %{REQUEST_FILENAME} -d

    RewriteRule ^.*$ – [NC,L]

    RewriteRule .* index.php [L]

     

     

    AddHandler application/x-httpd-php52  .php52 .php

     

     

     

     

    • Hello Shawn,

      You are better off writing either a php or pythong script to change your PHP version and set it to a cron job to run hourly. What type of scenario would require this type of setup?

      Kindest Regards,
      Scott M

  • Hi,

    I am trying to install open-classified but I have the following error (even after swithing the php version to 5.5 in Cpanel)

    • Required PHP version greater than equal to 5.5.0 AND found version is : 5.4.40

     

    Help Pls.

    Thanks.

    • Hello Ghislain,

      Thank you for contacting us. We are happy to help, but will need some additional information.

      Did you verify the PHP version is changing with a PHPinfo page?

      How are you installing Open-Classified?

      If your problems persist, it may be beneficial to contact Live Support, so they can test your specific account.

      Thank you,
      John-Paul

  • Hi,

       If I change my PHP version from 5.4 to 5.5, do I need to get a new php.ini file (which is currently on v5.4)?

    I am facing a peculiar problem for which I want to try higher php version:

    For initial couple of days the below PDO code worked fine but suddenly it is giving error.

    $this->_pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);

     

    I don’t know what config has changed but my code did not change.

    Regards,

    Sagarme

    sagarrakholiya.com

    • Hello,

      It is possible you need to make some changes in your php.ini file based on version. The main server copy gets this done automatically, but you would need to change any php.ini files that are in individual cPanel accounts.

      Kindest Regards,
      Scott M

    • Hello ray,

      Thank you for your question. Yes, it can affect your website, depending how it was developed/coded.

      For example, if you are using a software that is only compatible with PHP 5.3, changing to PHP 5.5 may cause errors.

      Thank you,
      John-Paul

  • Hi,

       If I change my PHP version from 5.4 to 5.5, do I need to get a new php.ini file (which is currently on v5.4)?

    I am facing a peculiar problem for which I want to try higher php version:

    For initial couple of days the below PDO code worked fine but suddenly it is giving error.

    $this->_pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);

     

    I don’t know what config has changed but my code did not change.

    Regards,

    AK

    • Hello Amal,

      Sorry for the problem with the PDO code. Servers are continually updated to keep them current, so it’s possible that older PHP code scheduled for deprecation could be causing the issue. You do not need to get a different PHP.INI file if you’re switching to PHP 5.5. If you don’t have specific settings in your local PHP.INI file, you can also re-name it and your account will use the server PHP.INI file.

      If you continue to get errors, please indicate your domain name and we can research the issue for you in more depth.

      Kindest regards,
      Arnel C.

    • Hello Vikky,

      Thank you for your question. Yes, by following the guide above, you can change your account to use PHP 5.5.

      If you have any further questions, feel free to post them below.

      Thank you,
      John-POaul

  • I noticed you said php 5.3 must be installed. I have 5.4. So I need to downgrade to 5.3 in whm via easyapache and this switch appear in my cpanel accounts automatically?

    • Gabriel,

      Yes, in order to have the PHP switcher put into place, the DEFAULT version of PHP that would be installed would need to be 5.3. However, that doesn’t mean that you’re stuck with 5.3. You can simply switch to 5.4 or higher.

      Regards,
      Arnel C.

    • Hello Gabriel,

      Thanks for the question. The switcher can be added, but it would need to be done by our systems people. You would need to submit a support ticket requesting that it be installed. Please be aware that this switcher requires that PHP 5.3 be installed as the default version of PHP on the server.

      I hope that helps to clarify the issue!

      Regards,
      Arnel C.

  • Can you update the article and mention that sometimes the switcher doesn’t work, and that you need to manually edit your .htaccess to get the job done? I just had to add the following to my .htaccess file because cPanel failed to do it:

     

    AddHandler application/x-httpd-php55 .php

    • In 99% of cases, the PHP switcher will work just fine, however, depending on some account configurations, you will need to adjust it manually.

  • Is there a lag time before the newly selected version takes effect? Im on a shared account, and I changed the PHP version to 5.4, but cPanel is still reporting my php version as 5.3.28 and so does my WordPress installation.  So far it’s been about a half hour since I made the change in the PHP configuration as outlined above. And when I return to the PHP Configuration Page, the dropdown is set to 5.4, but everything else seems to indicate that I’m still on 5.3

    • The changes will be instant. Sometimes, depending on your existing .htaccess file, the PHP version changer can fail to properly write the needed line in which you will need to add this manually. The following article will provide you with the line that you would need to add to your .htaccess file:

      Using multiple PHP versions on one account

      Simply place the appropriate line for your desired PHP version into the .htaccess file of your home directory and it will then take effect.

  • When will PHP 5.5.12 be supported?  It has a bunch of security patches.

     

    The maintainers of PHP have released two new versions of the scripting language that fix a number of bugs, including a pair of vulnerabilities related to OpenSSL. Versions 5.4.28 and 5.5.12 both contain that important patch, as well as fixes for more than a dozen other vulnerabilities.

    The fix for the OpenSSL flaws is in both PHP 5.4.28 and 5.5.12. Both versions also include a slew of other bug fixes, one of which is for CVE-2014-0185, a privilege escalation flaw. The bug could allow an attacker to run arbitrary code in some situations.

    • We specifically patch all servers to ensure vulnerabilities such as this are not an issue. Rest assured at any disclosed vulnerabilities are immediately addressed across all environments.

Leave a Reply