Cant install php on Apache & Windows 7 64 - php

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).

Related

PHP extensions are not recognized by Apache

Running php -m on the command line I can see all of installed PHP extensions. However, on phpinfo() output I can not find some of them e.g. mbstring. What is wrong with it? I use PHP 5.6 and Apache http server 2.4 on windows 7 all 64b.
Did you really not overlook anything?
Add PHP settings in httpd.conf:
LoadModule php5_module "your_path_to\php\php5apache2_4.dll"
AddHandler application/x-httpd-php .php
PHPIniDir "your_path_to\php"
Remove the comma in php.ini: ;extension=php_mbstring.dll to extension=php_mbstring.dll!
It should work now.

httpd: how can I understand where the error in httpd.conf is

I'm trying to install PHP on Apache httpd server 2.4 on Windows. Yes, I know that that is extremely simple. But after adding the following three lines httpd start operation fails.
LoadModule php5_module C:/PHP/php5apache2_4.dll
AddHandler application/x-httpd-php .php
PHPIniDir "C:/PHP"
I'm not trying to asc what is done wrong after giving you three lines, I want to know can I somehow understand where the problem is (in error.log I do not have any message about errors while start).
Thank you in advance!
You need to load php dll file using LoadFile directive:
LoadFile "c:/server/php/php5ts.dll"
in this case, php5ts.dll is name of the dll file, but you may need to change it to php5nts.dll based on whether you use thread safe.

Cannot start Apache (c:/php/php5apache2_4.dll into server: The specified module could not be found)

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>

Configureing php to use with apache

I am using Apache 2.2.3 server on RHEL5. In my system, php is installed (PHP 5.1.6). I placed a simple php script
<?php
phpinfo();
?>
in my /var/www. However, when I start my server (it starts fine) and go to the php page, it does not show anything. My local machine has ubuntu installed, where I can see the file properly.
Following the information provided here (http://dan.drydog.com/apache2php.html), I did following things:
Added following lines to /etc/httpd/conf/httpd.conf
LoadModule php5_module modules/libphp5.so
AddHandler php5-script .php
AddType text/html .php
AddType application/x-httpd-php-source phps
restarted httpd,
service httpd restart
But I still don't see any results. What am I doing wrong?

Trouble adding PHP modules to Apache 2.2 Server

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.

Categories