If you need assistance updating your site to support modern versions of PHP, DreamHost's Professional Services may be able to assist you in updating your code.
It's not possible to change the PHP version of DreamPress sites in the panel, as it is a service managed by DreamHost. If you need to change the PHP version of a DreamPress site, please contact support for assistance.
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.
Changing the PHP version
To change the PHP version on any of your domains/subdomains within the panel:
- Navigate to the Websites page.
- Click the Manage button to the right of your domain.
- Under the PHP section, click the Modify icon.
- Choose a version of PHP from the dropdown menu.
- Scroll down and click the Change PHP Version button to save your changes.
Changing the PHP version on your site using an .htaccess file
Be cautious when using this method over long periods of time. The DreamHost panel will reflect the current PHP versions on your server, and it is the ideal place to update which version of PHP your site is using. If you use .htaccess to force a version that has reached its End of Life, your site may experience issues when that version is removed from the server.
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.4:
AddHandler fcgid-script .php
FCGIWrapper "/dh/cgi-system/php74.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.