The error "cannot load php5apache2_2.dll into server" is prompted when Apache is started"

Source: Internet
Author: User
Tags vc runtime vc9

The error "cannot load php5apache2_2.dll into server" is prompted when Apache is started"



Fault symptom:


The error message "syntax error on line 122 of D:/Apache/CONF/httpd. conf: cannot load D:/PHP/php5apache2_2.dll into server ", which causes Apache to fail to start.


The Apache configuration file D:/Apache/CONF/httpd. conf contains the following line 122nd:


Loadmodule php5_module D:/PHP/php5apache2_2.dll

Phpinidir "D:/PHP"


Note: D:/PHP/php5apache2_2.dll is the corresponding path for installing PHP. Apache is version 2.2.17 and PHP is version 5.3.6.


Cause of error:


Compile "indicates that the PHP installation file of this version is compiled by VC. Therefore, to run or call the relevant files in the PHP compressed package, you must first install the runtime environment of VC. If your machine does not have a VC runtime environment installed, Apache will prompt the above error message when calling related files in the PHP compressed package.


Solution:


  Search for "vc2008 reusable components" or "vc2008 Runtime Library" on the Internet, and download and install the component to solve the fault.


Other causes and solutions for this error:


Cause: because of the different Apache versions, the corresponding "php5apache2. dll" is also different. If you load the incorrect "php5apache2. dll", this error message is displayed.


Example: If you are using apache2.2, this error occurs when you use the statement "loadmodule php5_module modules/php5apache2. dll" to load PHP. The configuration of this code should be changed to "loadmodule php5_module modules/php5apache2_2.dll" or "loadmodule php5_module" D:/PHP/php5apache2_2.dll "".


Summary:


Apache2.2 corresponds to php5apache2_2.dll

Apache2.1 corresponds to php5apache2. dll

Apache1 corresponds to php5apache. dll

For the above reason, if you have installed apache2.2 and php5.0, an error will occur. When installing Apache and PHP, you should select the corresponding version for configuration and installation.

From: http://bbs.chinaunix.net/thread-3581500-1-1.html

Install apache2.2 + php5.3 + mysql5.5.15 in Windows 1. Apache 2.2 
Next step.

2. php 5.3.6 
Currently, only the thread safe or non-thread safe versions compiled by vc9 are provided.

For development and use, select thread safe (this version is generally used in the development environment in the window. If you use FastCGI to execute PHP, you need to use the none thread safe version ).

I used to download the zip version, that is: php-5.3.6-Win32-VC9-x86. note that if you run php5.3 or above compiled by vc9 in win2003/XP, you may be unable to perform the operation. When you double-click php.exe, the question "application cannot be started due to incorrect application configuration" appears, this is because this version of PHP uses vc9 compilation, and the win2003 system lacks the Runtime Library, you can install Microsoft
2008 C ++ Runtime (x86) to ensure running.

Problem: FAQ: Configure httpd in Apache. in Conf, The loadmodule php5_module lacks "php5apache2_2.dll" because the PHP version is incorrect and php5apache2_2.dll is available in the thread safe version, none thread safe does not have this file. It is generally used only for FastCGI, so this file is not required.

Link Apache and PHP, modify Apache HTTP. conf, and add the following lines:

From: http://koda.iteye.com/blog/1148942

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.