October 2011
« Sep   Nov »

How to enable PHP work with Apache on 64 bit Windows 2008 server

It’s something really annoying you that when you are doing a same job which fairly easy, but got stuck at the same point again and again. Also the same time you forget how you had solved it on last time.

Making you really frustrating and impatient while you are troubleshooting with. The best resolution is that,

1. Spend max. an hour for similar issues.
2. If there is no luck yet, just leave your seat and keep away hands from keyboard for a while.
3. Think the possibilities to happen and re-collect the actions/thoughts you had having the last time.
4. Refresh your minds and start from the scratch

Here is my scenario,

I need to run PMA ( phpmyadmin) on windows server through Apache. After installing PHP (used php windows installer downloaded) I can’t start the Apache. I can start it after removingthe php library entry from the httpd.conf file.

I used : PHP 5.2.14 Windows 64 Installer along with Apache 2.2.3 32 bit installer.

Solution :
1. I added php path in system path (c:\PHP) and type php -m from the command line. Which throws me file missing error followed by Windows system error closing message. So I think php installs has got crashed.
2. Uninstall the PHP from add/remove programs
3. Download and extract it to C:\PHP. Rename php.ini-production to “php.ini
4. Add the following entry in Apache,
LoadModule php5_module “C:\PHP\php5apache2_2.dll”
AddType application/x-httpd-php .php
PHPIniDir “C:\php”

5. Restart Apache. It’s running !!!!!!!!!!!! 🙂

Scenario TWO

Next I need to enable certain extensions required for PHP to run PMA like php_mysql, php_mbstring and php_mcrypt

The default php.ini won’t enable it
1. Un comment the lines in “php.ini” respect to each module entry and restart Apache. But not luck 🙁 extension was not there.
2. I verified it by executing #php -m
C:\Users\Administrator>php -m
PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\php\php_mbstring.dll’ – The specified module could not be found. in Unknown on line 0
[PHP Modules]

How to solve this kind of error ???

Extension_dir path was incorrectly set in php.ini and I changed it to extension_dir = “C:\PHP\ext” then restart Apache.

Verify it by >php -m and found the modules listeted in it. Great !!! 🙂 a SIMPLE task is over .. which involve unwanted impatient.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>