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.
As DreamPress is a service managed by DreamHost, the minimum supported PHP version cannot be lowered. However, a DreamPress staging website can be used to test higher versions of PHP, and publish those changes to your live DreamPress site. View the following article for more details:
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
Your domain must be Fully Hosted on a server to change the PHP version. 'DNS Only,' Parked, and Redirect domains do not have PHP options.
To change the PHP version on any of your domains/subdomains within the panel:
- Navigate to the Manage Websites page.
- Click the Manage button to open the Domain Settings page, which allows you to adjust various settings for your site.
- Under the PHP section, click the Modify icon.
- Choose a version of PHP from the dropdown menu.
The following two options appear if the upgrade fails:
- Revert to previous PHP version — Reverts to a previous version, which allows you to resolve any issues at a later time without causing site errors (recommended).
- Change PHP version anyway! — Changes the PHP version, which may cause compatibility errors on your website (not recommended).
- Click the Change PHP Version button.
The following error message appears if your website's code is not compatible with the new PHP version you have selected:
- PHP Change Unsuccessful. example.com has been reverted back to PHP version x.x.
If you selected Revert to previous PHP version, the PHP version is not changed. You could then use the following article to locate and update the incompatible code before attempting to change the PHP version again.
Changing the PHP version on your site using an .htaccess file
Be cautious when using this method over long periods of time. 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 8.2:
AddHandler fcgid-script .php
FCGIWrapper "/dh/cgi-system/php82.cgi" .php
If this causes any problems, then remove the lines to switch back to your previous settings.
Making this change also adjusts the PHP version displayed in your panel on the Manage Websites page. However, it may take up to 24hrs for it to update.