Home >Backend Development >PHP Problem >How to solve the error problem of apache2.4 php5.6
##The operating environment of this article: windows7 system, PHP5.6 version, DELL G3 computerApache2.4 php5.6 error solution: 1. Open the httpd.conf file and load the php configuration file; 2. Modify the configuration information in php.ini; 3. Specify the path to the expansion package.
Apache2.4 PHP5.6 configuration tutorial and solutions to problems such as the Apache service failing to start and the php configuration file not taking effect
When I first learned PHP, I used Apache2.2 php5.4 mysql5. 5 combination, because I am preparing to learn Laravel and have higher requirements on the PHP version, so I changed it to PHP5.6. At the same time, because Apache2.2 does not support PHP5.5 and above, I also need to change the Apache2.4 version. The following records the replacement process and commemorates the solutions to various problems encountered during the process. First is the download of php5.6, no doubt, download the latest php5.6 in the upper right corner of the php official website (www.php.net), here It is a windows environment. You need to click the last option of windows downloads,and then select zip download. The download speed is generally OK. Here is 64-bit, and 32-bit is below. I can’t explain the diagram clearly. Check The results obtained from the data
#加载PHP LoadModule php5_module "D:/wamp/php5/php5apache2_4.dll" #分配工作给php模块 AddType application/x-httpd-php .php .phtml #加载php配置文件PHPIniDir "D:/wamp/php5"
Pay attention to your path and the symbols/spaces in the code, it will almost never take effect. At this point, the configuration of Apache is completed. You can use the ApacheMonitor program or httpd.exe or cmd command in the bin directory in the Apache directory (httpd.exe -w -n "Apache2.4" -k start, this command can also display the error reason for startup failure) or in the windows service Start the Apache service. After normal startup, you can access localhost with your browser. If It Works appears, it means Apache is running successfully. You can create a new php file in the default website root directory (htdocs directory under the Apache directory) and write phpinfo() in it. ;, open the browser to view the php version information. If the normal display shows that php has been successfully added to Apache
According to convention, some commonly used PHP extensions should be enabled below, generally including curl, mbstring, mysql, mysqli, PDO_mysql, etc. The method to enable them is to find a string of codes similar to extension=php_mysql.dll in php.ini, which will require Just remove the semicolon in front of the enabled extension. No explanation will be given.
A problem I encountered here is that after opening the extension, restarting the Apache server N times did not take effect! I once suspected that there was something wrong with the Apache configuration. After checking the information and constantly trying, I found a very low-level error, that is, php also has its default path c:\php. Anyway, it is on the c drive. I have the d drive here, so I need Specify the path of the extension package: extension_dir = "D:/wamp/php5/ext", and then find that the extension is finally enabled.
Since I have already installed Mysql5.5 before, I have forgotten the specific steps, so I won’t be stupid here.
To summarize, the most common problem I encountered during this upgrade process is that the default paths of Apache and PHP were not modified in time. Their default paths are all on the c drive. Generally, we will not change our own paths under Windows. The file is placed on the C drive, so I believe most people will experience these problems. I hope it will be helpful to you, and it will also be a reference for me to upgrade again in the future.
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of How to solve the error problem of apache2.4 php5.6. For more information, please follow other related articles on the PHP Chinese website!