How do I change the PHP version of my site?
source link: https://help.dreamhost.com/hc/en-us/articles/214895317-How-do-I-change-the-PHP-version-of-my-site-
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
How do I change the PHP version of my site?
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.
Overview
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
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 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. 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.
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.
Choosing between CGI and FCGI
View the following article for differences between CGI and FCGI.
See also
Did this article answer your questions?
Recommend
-
16
PHP – new features and version overviewThe new stable version of PHP 7.4 is here. Released just a couple days ago on November 28th 2019, it introduced quite a few significant changes. They include new functions and syntax updates...
-
7
Overview The PHP language has a special built-in function called phpinfo() that retrieves information about the PHP environment used on your site. You can view this information by creating a phpinfo.php file and uploading it...
-
5
How do I change the PHP version my shell uses? Overview When you run the php command on the server, it uses the system version (which changes over time). You can s...
-
5
How to detect if the User's OS prefers dark mode and change your site with CSS and JS Sponsored By I got a twe...
-
3
Local development This is the git repo for the official www.php.net website. To setup a local mirror of the website: $ git clone https://github.com/php/web-php.git $ cd web...
-
3
March 10, 2022
-
6
How Web Scraping Can Help Yo...
-
5
Faster than Hugo or Zola A Static Site Generator in PHP Can PHP compete against a CMS created in Go or Rust and still be more performant? And if so, what are the essential el...
-
21
How to change PHP version in XAMPP on Mac I need to change default php 8.2 come with XAMPP latest version to 8.0.2 which we’re running on production server. brew install [email protected] msd@MSDs-Mac-mini base % php -v PHP...
-
2
The change in speed of the site As I mentioned in my last post, I finally moved this site over to Digital Ocean hosting because Dreamhost was just getting too expensive for my liking. It was more than I would car...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK