Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of apache2.4 php5.6 error

2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article introduces the relevant knowledge of "how to solve the problem of apache2.4 php5.6 errors". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Apache2.4 php5.6 error solutions: 1, open the httpd.conf file, load the php configuration file; 2, modify the configuration information in php.ini; 3, specify the path of the expansion package.

This article operating environment: windows7 system, PHP5.6 version, DELL G3 computer

Solutions to Apache2.4+PHP5.6 configuration tutorials and problems such as the failure to start Apache services and the ineffectiveness of php configuration files

When learning php, I used the combination of Apache2.2+php5.4+mysql5.5. Because I am ready to learn Laravel, I have higher requirements for the version of php, so I replaced php5.6. At the same time, because Apache2.2 does not support php5.5 or above, I also need to change the version of Apache2.4. The following is a record of the replacement process and the resolution of various problems encountered in the process.

First of all, there is the download of php5.6. There is no doubt. Download the latest php5.6 in the upper right corner of php's official website (www.php.net).

This is the windows environment, you need to click on the last option of windows downloads

Then choose zip download, download speed is generally OK, here is 64-bit, 32-bit below, I can not explain the diagram, check the results obtained by looking up the information

After downloading, extract it directly and rename the folder to php5 or php5.6 (feel free, but remember, it's useful later). I put it in php5 under the wamp of d: disk.

The second step is to download Apache and enter the official website of Apache. You will find that you are confused and do not know how to download. It seems that the official website only provides the source code, and there are no compiled binaries. Put the download address http://httpd.apache.org/docs/current/platform/windows.html#down directly.

Visual inspection of these five is OK, the second one I choose feels that the download speed is normal, look at the picture (pay attention to your version)

Download it and extract it directly. Here I put it in d:\ wamp\ Apache2.4, and remember the folder name.

At this point, the download and installation is complete, and then the configuration process begins.

First of all, it is a prerequisite that the Apache server will not take effect until the Apache and php configuration files are modified.

Cmd runs the command line window as an administrator, changes to the bin directory under the Apache directory, and executes the httpd-k install command to install the Apache service into the Windows service. If it is not run as an administrator, it will report an error.

It should be noted here that after executing the above command, if your Apache2.4 is not placed under c:\ Apache24, you will definitely report an error, because the default path in the configuration file is not the same as the path you put, so if you change the httpd.conf file in conf under the Apache directory, you can directly Ctrl+F search c:\ Apache24 to change all the default paths to your path, for example, here is d:\ wamp\ Apache2.4.

Then configure php to Apache, and in many LoadModule of the httpd.conf file, add the following lines of configuration:

# load PHPLoadModule php5_module "D:/wamp/php5/php5apache2_4.dll" # assign work to php module AddType application/x-httpd-php .php .phtml # load php configuration file

PHPIniDir "D:/wamp/php5"

Note that your path and the symbols / spaces in the code will not take effect at all. At this point, the configuration of Apache is complete. You can use the ApacheMonitor program or the 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 show the error cause of the startup failure) or the windows service. After normal startup, the localhost can be accessed by the browser. If It Works appears, it means that Apache is running successfully, and you can create a new php file in the root directory of the default website (htdocs directory under the Apache directory). Write phpinfo () inside The browser opens to view the php version information, and the normal display shows that php has successfully joined the Apache

Next, configure php to make a copy of the php.ini-development file in the php directory and rename it to php.ini and open it. First of all, let's talk about a small problem encountered. If you view the php version information, there is a warning under data.

All I know is that this is the time zone problem of php. The solution: modify the configuration information according to the figure in php.ini:

According to convention, you should open some commonly used php extensions, such as curl,mbstring,mysql,mysqli,PDO_mysql, etc. The way to open them is to find a string of code similar to extension=php_mysql.dll in php.ini, and remove the semicolon in front of the extension that needs to be opened without explanation.

One of the problems I encountered here is that after opening the extension, I restarted the Apache server N times, but it didn't take effect! It was suspected that there was a problem with the configuration of Apache. After checking the information and trying again and again, I found a very low-level error, that is, php also has its default path c:\ php. It is on disk c. Here I am on disk d, so I need to specify the path of the extension package: extension_dir = "D:/wamp/php5/ext", and then find that the extension is finally enabled.

Since Mysql5.5 has already been installed before, I also forgot the specific steps, so I don't charge fat people here anymore.

To sum up, the most problem I encountered in this upgrade process is that I did not modify the default path of Apache and PHP in time, their default path is disk c, generally we will not put our files on disk c under windows, so I believe that most people will experience these problems. I hope it will be helpful to you, and it is also a reference for me to upgrade again in the future.

This is the end of the content of "how to solve the problem of apache2.4 php5.6 errors". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report