You are here

Switch PHP version of Drupal on Webfaction

Often we encounter problems when hosting Drupal site on shared servers like webfaction. The PHP version that we used while development of the site is not there on the hosting server. If you are using webfaction then the steps below can be used to switch your site's PHP version.

Create a symlink to the version of php you want.

  1. ln -s /home/php-cgi/php56.cgi php56.cgi

This symbolic link will work for webfaction. Check with your hosting provider the location of php56.cgi file path.

Now add the following lines in the end of Drupal's .htaccess file

  1. Action php56-cgi /php56.cgi
  2. <FilesMatch \.php$>
  3. SetHandler php56-cgi
  4. </FilesMatch>

That is it. Go to Drupal's Status report and you should see PHP 5.6 now being shown as the PHP version.