FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


PHP5 MySQL Config on XP





regards
I just installed Apache/PHP5/MySQL on my Windows PC with XP Home OS. I followed the Tut Installing PHP under Windows by Matthew Phillips Referred to in the Post: Easy to understand Apache/PHP/MySQL install on XP box

This worked OK aside from a couple obvious differences. I had the most troube getting MySQL configured with PHP and had to do some searching to find the answer. Here is what I had to do to get it working.

In the Apache httpd.conf File at 'C:\Program Files\Apache Group\Apache2\conf\httpd.conf' You have to add these lines for PHP5

LoadModule php5_module php5apache2.dll
AddType application/x-httpd-php .php

In addition to installing MySQL etc. I had to do this to get MySQL to work:

1. Make sure that you have a valid php.ini in your windows directory.
OR (Per the tut the 'php.ini' can be installed in the 'C:\Program Files\Apache Group\Apache2' folder. This works fine.)
2. copy libmysql.dll to the system32 directory (php_mysql.dll would not load without doing this)
3. set the extension_dir in php.ini to the ext directory of your PHP installation directory (like e.g. extension_dir=C:\php5\ext)
4. enable the MySQL extension in php.ini by uncommenting the line extension=php_mysql.dll
5. Restart Apache Server

Wink R-e-g-a-r-d-s
coreymanshack
Thanks, but I'm sure there ARE tutorials out there that tell you all of this anyway, I remember when I first started php I found one, although I can't recall it.
bladesage
I also had trouble getting MySQL to work with PHP on my local server. I sat there for hours, trying so many different solutions, and none of them worked! The thing is, you can still see that the mysql extension is there, if you type C:\php5\php.exe -m into the Command Prompt; so the problem must be between PHP5 and Apache. As it states in the setup instructions for MySQL in the PHP Documentation that, while copying libmysql.dll into the system32 directory will work, it is not wise to do so. You should follow the directions there to add the PHP5 installation directory to the PATH environment variable, instead.

That aside, I found a method that allows me to make almost any PHP extension work, and it even allows me to run multiple versions of PHP at once. Instead of running PHP as an Apache module, run it as a CGI binary. Here's how:

1. In the httpd.conf file, remove the following two lines:
Code:
LoadModule php5_module php5apache2.dll
AddType application/x-httpd-php .php


2. At the very end of the httpd.conf file, place the following lines:
Code:
ScriptAlias /php5/ "c:/php5/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php5/php-cgi.exe"

<Directory "c:/php5">
Order allow,deny
Allow from all
AllowOverride All
</Directory>


3. Save the changes to the file, and restart the Apache server.

Does that help? I may have forgotten something...let me know if there's a problem.
the-guide
bladesage wrote:


............Instead of running PHP as an Apache module, run it as a CGI binary. Here's how:

1. In the httpd.conf file, remove the following two lines:
Code:
LoadModule php5_module php5apache2.dll
AddType application/x-httpd-php .php


2. At the very end of the httpd.conf file, place the following lines:
Code:
ScriptAlias /php5/ "c:/php5/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php5/php-cgi.exe"

<Directory "c:/php5">
Order allow,deny
Allow from all
AllowOverride All
</Directory>




I had the same trouble too, I have tried to setup personal web server for days with:

apache_2.0.58-win32-x86-no_ssl.msi
php-5.2.1-win32-installer.msi
mysql-5.0.45-win32Setup.exe
and
mysql-gui-tools-5.0-r12-win32.msi

But I can't getting MySQL to work with PHP, today I tried to run it as a CGI binary like your advice but it still not work, Do you think it happen from my setup file? Or any other?

Thanks,
R. Apichart
Fire Boar
... or just use something like WAMP or XAMPP.

Wink
manav
wamp is great... it's damn dead easy to configure also... try it out
tamilparks
ok i will try with my XP
the-guide
manav wrote:
wamp is great... it's damn dead easy to configure also... try it out


Hi, manav

I've searched for 'WAMP' and found it ready, now I'm loading 'WAMP5 1.7.3', is that right? I will look around their help support and will try with it once, after that, may be, I need some help from you again if I have any troubles. Question Arrow Idea

Thanks very much "manav".

R. Apichart
Related topics
simple php problem, please help...
Which book is best for beginner of PHP and MySQL?
need help enabling GD php extension
when i can avail my domain?
MySql upgrade...
Installing phpBB2 with WAMP
Getting host to connect to my local mysql?
software livre , os melhores e mais uteis ?
Optimizing a mySQL database
Problem launching phpmyadmin under Ubuntu
PHP and MySQL Books
Can't get into myphp : error message ... (10061)
Apache/Php5/MySql = Complete Fustration
lightest linux
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.