Home > Backend Development > PHP Problem > How Apache changes PHP version information

How Apache changes PHP version information

醉折花枝作酒筹
Release: 2023-03-09 11:52:02
Original
2132 people have browsed it

Method: 1. Execute the "find / -name" command to find the path of the upgraded "php.ini" file; 2. Add "PHPIniDir space new php.ini path" to the "httpd.conf" file , change the php version; 4. Execute the "service" command to restart the service.

The operating environment of this tutorial: windows7 system, PHP5.5&&PHP5.6 version, DELL G3 computer

1. Check what PHP is used by Apache Version

Create a new document, name it info.php, and upload it to the root directory of the website (such as: /var/www/html/)

info.php document content:

<?php
phpinfo();
?>
Copy after login

Visit http://domain name or IP/info.php, you can check the current Apache version (I have already configured it, so it is version 5.6)

2. Use the find command to find the path to the upgraded PHP configuration file php.ini (such as: /etc/php.ini)

find / -name php.ini
Copy after login

3. Find the httpd.conf file and add the following code at the end (if you don’t know the path, you can use the find / -name command to find it. )

PHPIniDir 空格 php.ini路径
Copy after login

For example:

PHPIniDir /etc/php.ini
Copy after login

4. Restart the http service, visit http://domain name or IP/info.php and check whether it is successful

service httpd restart
Copy after login


Recommended: "2021 PHP Interview Questions Summary (Collection)" " php video tutorial

The above is the detailed content of How Apache changes PHP version information. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template