I run a Windows 7 x64 machine with apache 2.2 and PHP 5.2.17
Whenever I try to add the PHP dll to the httpd.conf file, apache will not start.
this is how it is being put into httpd.conf
LoadModule php5_module "C:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/php"
I have successfully managed to setup and run a Apache server with PHP before, so I'm not new to this, but I'm fairly certain that this is right.
If everything that's being output on launch is the DNS error, Apache is launching just fine. FQDN resolution is a warning, not an error.
Related
I have installed Apache, added
LoadModule php5_module c:/php/php5apache2_4.dll
AddHandler application/x-httpd-php .php
PHPIniDir "c:\php"
to httpd file, set up php.ini file (im using thread safe 5.5.10 x64 version), but when im trying to run apache im getting message "the requested operation has failed".
Try this:
Use forward slashes
Enclose the path to the dll in quotes
Double check the paths and directory names
LoadModule php5_module "C:/php/php5apache2_4.dll"
AddHandler application/x-httpd-php .php
PHPIniDir "C:/php"
As user ChrisForrence suggested i was attempting to run incompatible versions of apache and php. Finally, i was able to find detailed tutorial on youtube here https://www.youtube.com/watch?v=17qhikHv5hY which taught me ho to install apache and php (there's another movie by same user about latter).
Well I tried to install PHP 5.5.9 and I followed the procedure in this video exactly: http://www.youtube.com/watch?v=6Y6lOHov3Bk
Basically I pasted these lines in the httpd.conf file, saved and restarted my computer.
# For PHP 5 do something like this:
LoadModule php5_module "c:/php/php5apache2_4.dll"
AddType application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "C:/php"
And now when I try to start Apache it does not work, and the last line in the error log is the following.
(Cannot start Apache (c:/php/php5apache2_4.dll into server: The specified module could not be found)
The only thing I can think is that when I downloaded the PHP 5.5.9 zip file and unpacked it, it did not have the php5apache2_4.dll file so I had to download it from a 3rd party website: http://download12.mediafire.com/9ory5zibr0zg/ncwlddm9cclwc99/php5apache2_4.dll
You don't state whether you have x86 or x64, but the php5apache2_4.dll is only in the Thread Safe binary.
http://windows.php.net/download/
I faced same issue in windows 7 64bit Pro, when installed wampserver3.0.4_x64_apache2.4.18_mysql5.7.11_php5.6.19-7.0.4.exe.
The error in windows Event Viewer (though the file was there) :
The Apache service named reported the following error:
httpd.exe: Syntax error on line 184 of C:/wamp64/bin/apache/apache2.4.18/conf/httpd.conf: Cannot load c:/wamp64/bin/php/php5.6.19/php5apache2_4.dll into server: The specified module could not be found.
Soultion :
Try 1: First installed vc_redist.x64.exe as suggested by others (did not solve the problem)
Try 2:
Modified the below line in C:\wamp64\bin\apache\apache2.4.18\conf\httpd.conf
//old line
#LoadModule php5_module "c:/wamp64/bin/php/php5.6.19/php5apache2_4.dll"
//New line
LoadModule php7_module "c:/wamp64/bin/php/php7.0.4/php7apache2_4.dll"
After this WAMP can start, icon shows green, I can use for my developments.
Note : Another wamp related problem still exists in my system, when I click on the green wamp icon, the wamp menu does not open. I am researching now to resolve it.
The problem is that you need Microsoft VC++ 2012 distributable installed for PHP 5.6 to work. Once you install this, it should work fine for this.
Here is the configuration
LoadModule php5_module "c:/php/php5apache2_4.dll"
<IfModule php5_module>
# configure the path to php.ini
PHPIniDir "C:/php"
AddHandler application/x-httpd-php .php
</IfModule>
I want to install dompdf, and so I need PHP, and consequently Apache (for instance) installed. I've managed to install Apache 2.0.64 on my Windows 7 64 bit. It was apparently working fine, until I've installed PHP 5.4.9 and configured httpd.conf, so Apache could "see" the PHP installation. I've been using this link for guidance on that -> http://www.webdevelopersnotes.com/how-do-i/install-PHP-windows-7.php After that, when I try to start Apache2 the "The requested operation has failed!" error pop-up appears. If I comment the lines that I've inserted into httpd.conf, Apache works again. The lines are:
AddType application/x-httpd-php .php
(...)
LoadModule php5_module "c:/Program Files (x86)/php_5.4.9/php5.dll"
(...)
PHPIniDir "C:/Program Files (x86)/php_5.4.9"
I've spent a lot of hours and searched but couldn't find a similar problem to mine nor a solution of my own. Does anybody has a hint on this?
Thank you very much,
João
I'm trying to configure apache 2.2 for php 5.2 (or preferably 5.3, but php.net seems to say not to) on Windows Server 2008.
C:\Apache2.2\
C:\php\v5.2\
Apache is running fine before I add this to httpd.conf
LoadModule php5_module "C:/php/v5.2/php5apache2_2.dll"
AddHandler application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "C:/php/v5.2/"
Then apache spits out this error when I try to restart it from cmd:
httpd.exe: Syntax error on line 129 of httpd.conf: Cannot load C:/php/v5.2/php5apache2_2.dll into server: The specified module could not be found.
It's definitely there!
I googled the error and found a lot of people complaining of it, but they're all for mistakes like referencing php5apache2.dll instead of php5apache2_2.dll.
EDIT: btw, when I use the installer, and it modifies httpd.conf for me, I still get the cannot find error during start up. wtf…
turns out the LoadModule […] has to go at the very end of httpd.conf. dunno why, but i moved it, and apache stopped complaining.
I had my Apache 2.2 installed on windows. Now I just finished installing PHP on the Apache server. As the instruction says, I need to edit the httpd.conf of my Apache and add:
#
LoadModule php5_module "G:\Program Files\PHP\php5apache2_2.dll"
AddHandler application/x-httpd-php .php
PHPIniDir "G:\Program Files\PHP"
I made sure the directory is correct. Then I restart my server again. I have a hello.php file in my htdocs. And I navigate to localhost:8080/hello.php and it says server not found, however when I do index.html. It display's the html correctly on the htdocs folder.
What am I doing wrong here? I tried to debug this by trying to execute hello.php from the command line by executing G:\Program Files\PHP\php-cgi hello.php, but then it says:
'G:\Program is not recognized as internal or external command.....
You can use some this like XAMPP its easy to configuration.