Configure your hosting account to run php 7

There are two methods to enable php 7. The first method enables php 7 globally for your entire account. This may cause problems if you have legacy code that relies on features removed in php 7. The second method will allow you to enable php 7 on only part of your account.

Note: These instructions are for phpwebhosting.com servers. If you have reached this page via internet search, the instructions for method two should work with most hosting companies given minor changes (you'll likely have a different path for php7). If your host does not support php 7, we invite you to sign up for a hosting account with us.

Method one - enable php 7 globally

  1. Login to your hosting control panel at https://phpwebhosting.com/login/
  2. Once logged in, click on the "php" section near the top middle of the screen.
  3. Click the link "Set php version"
  4. Select "php 7.x" as your php version.
  5. Click the "Change php version" button

The change to your php version will take place at the next quarter of the hour - ie. at :00, :15, :30 or :45 minutes past the hour.

You may also want to confirm your site is running php 7

You'll next need to check two possible issues with the php 7 upgrade:

Method two - enable php 7 for only part of your account

To enable php7 for only part of your account, create a file called ".htaccess" inside the sub directory that you want php 7 enabled on. If you already have a .htaccess file, add the code below to it.

AddHandler custom-php .php .pcgi .phtml .inc .phtml~ .php~ .inc~
Action custom-php /cgi-sys/php7.0

This will cause the directory in which the .htaccess resides and all sub-directories to run php 7.

The changes above will take place immediately. Just upload the .htaccess file and reload the page in your browser.

You may also want to confirm your site is running php 7

You'll next need to check two possible issues with the php 7 upgrade:

Note: We recommend that you revert to using method one as soon as you are able to. Method one will avoid confusion and (slightly) speed up your site. .htaccess file are loaded and parsed on each page load. Method one avoids this.

In addition, .htaccess files override settings in your control panel. This can prove to be confusing in the future if you change your php version in the control panel and have forgotten that you have the .htaccess file in place.