Home>Article>Backend Development> How to switch the php version in apache
When we open apache, we can see that php has many version numbers. When we don’t want to use php5, how should we switch the version to php7? The editor will introduce to you the switching method below.
Open the official website and find the FAQhttps://www.appserv.org/en/faq/
Question
to switch Version of PHP do?
Answer
to the Shortcut -> PHP Version Switch switch PHP Version needed immediately.
Find the php version switch in the start menu of win10, click it, and the dialog box will flash and then disappear quickly.
Enter localhost/phpinfo.php in the browser address bar
In the PHP version under Core, php The version number remains unchanged (5.5.*)
Open the AppServ/php5/extras/swver.php file, we found that
The following code is Judgment statements, etc., but we can see $conf and modify it according to the path
Open D:/AppServ/Apache24/conf/httpd.conf
Find the following code (about line 180)
LoadModule php5_module D:/AppServ/php5/php5apache2_4.dllAddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps PHPIniDir "D:/AppServ/php5/"Copy the two pieces of code
LoadModule php5_module D:/AppServ/php5/php5apache2_4.dlland
PHPIniDir "D:/AppServ/php5/"and add # in front of the original code
Change the 5 in the pasted code to 7
Restart Appche and run localhost/phpinfo.php
Success!
5 Failed to install laravel5.5
The openssl extension is required for SSL/TLS protection but is not available. If you can not enable the openssl extension, you can disable this error, at your own risk, by setting the 'disable-tls' option to true.Open php.ini and modify the configuration ssl, remove the comma ";" in front of extension=php_openssl.dll
Restart Appche!
Recommended learning:php video tutorial
The above is the detailed content of How to switch the php version in apache. For more information, please follow other related articles on the PHP Chinese website!