How do I change the PHP version of my site?


DreamHost offers several versions of PHP. When you add a site, there is an option to choose which version you'd like to use, but you can also change this version at any time in the panel.

It's not possible to change the PHP version of DreamPress sites as this is a service managed by DreamHost.

Changing the PHP version

To change the PHP version on any of your domains/subdomains within the panel:

  1. Navigate to the Manage Domains page.
    01 Domains Control Panel.fw.png
  2. To the right of your domain, click the Edit button under the ‘Web Hosting’ column.
    The ‘Manage Domains’ page appears:
    02 PHP.fw.png
  3. In the 'Web Options' section, select which PHP version from the dropdown menu which you’d like your site to run.
  4. You can check or uncheck Automatically upgrade PHP. This option only upgrades PHP if the version you're running is outdated.
  5. Scroll down and click the Change settings button to save your changes.

Changing the PHP version on your site using an .htaccess file

Aside from changing the settings in the DreamHost panel, you can also change the PHP settings using an .htaccess file.

View the following articles for instructions on how to create or edit your .htaccess file:

Simply add the following two lines in your .htaccess file which forces PHP to use PHP 7.2:

AddHandler fcgid-script .php 
FCGIWrapper "/dh/cgi-system/php72.cgi" .php

If this causes any problems, then remove the lines to switch back to your previous settings.

Choosing between CGI and FCGI

View the following article for differences between CGI and FCGI.

See also

Did this article answer your questions?

Article last updated PST.