logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: PHP 5.2.1 not communicating with MySQL 5.0.37 (Windows)
Author
rendezvous123



Joined: 24 Mar 2007
Posts: 4

PostPosted: Sat 24 Mar '07 13:41    Post subject: PHP 5.2.1 not communicating with MySQL 5.0.37 (Windows) Reply with quote

I've tried everything i could find and nothing works... I'm about ready to downgrade to PHP 4 just to see if that'll help.

PHP 5.2.1 is running perfectly; i am running Apache 2.2.4.

This is what i did as my usual installation process that relates to this:
    ▪ Uncommented extension=php_mysql.dll from the php.ini file.
    ▪ Set extension_dir = to point to my PHP extension directory.
These are all the suggestions i've tried that i've found/come across (and i made sure there were no multiple copies of the file libmysql.dll in all PATH locations) that did not work:
    ▪ Placed libmysql.dll from my Mysql/bin folder to C:/windows.
    ▪ Included the PHP directory in PATH.
    ▪ Placed libmysql.dll to Apache\bin folder.
    ▪ Downloaded libmysql.dll from the MySQL website and used that in place of the one that came with the PHP 5.2.1 package.
I'm not sure what else needs to be done for this to work. Any help would be highly appreciated! Mr. Green
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Sat 24 Mar '07 14:33    Post subject: Reply with quote

When you run mysqlinfo.zip from the download page, what happens?

Steffen
Back to top
rendezvous123



Joined: 24 Mar 2007
Posts: 4

PostPosted: Sun 25 Mar '07 4:10    Post subject: Reply with quote

I ran them both before making this topic. This is what they said:

MySQL wrote:
php MySQL extension not loaded !!

Check in php.ini if extension=php_mysql.dll is enabled, and that the extension_dir = is pointing to your php/ext folder.

Copy libmySQL.dll from your Mysql/bin folder to c:/windows.


MySQLi wrote:
php MySQL extension not loaded !!

Check in php.ini if extension=php_mysqli.dll is enabled, and that the extension_dir = is pointing to your php/ext folder.

I've followed both of their instructions, but did not work.
Back to top
fax



Joined: 05 Feb 2007
Posts: 24

PostPosted: Sun 25 Mar '07 5:54    Post subject: Reply with quote

When I started to use Apache, I had the exact same problem. Now please follow my steps very carefully and I will guarantee you 100% success rate.

If:
-> Apache is in C:\Apache2 (2.2.4 downloaded from here)
-> php in C:\php (5.2.1 from php.net, zip version)
-> MySQL in C:\MySQL (5.0.37 from mysql.com, zip version)
Do NOT download MySQL connector from mysql.com. It MAY not work
since it is for 5.0.27 and you are running 5.0.37.

Add C:\php and C:\MySQL\bin to PATH variable and NOTHING else.
Add PHPIniDir "C:/php" to httpd.conf file (where php.ini is loacted in C:\php).
Do NOT copy libmysql.dll to C:\WINDOWS or C:\WINDOWS\system32.
Check that you have limysql.dll in C:\MySQL\bin directory.
Uncomment extension=php_mysql.dll and extension=php_mysqli.dll in php.ini.
Plus all of the configuration for Apache to support php.
Restart Windows and you should be able to use MySQL from Apache.
Let me know if you have any problems (with Apache error log of course).
Back to top
rendezvous123



Joined: 24 Mar 2007
Posts: 4

PostPosted: Sun 25 Mar '07 9:05    Post subject: It's still the same... Reply with quote

fax wrote:
Add PHPIniDir "C:/php" to httpd.conf file (where php.ini is loacted in C:\php).

Not sure where to place that in httpd.conf, but i did do everything else in the instructions provided and it's all the same: No communication between PHP and MySQL.
Back to top
fax



Joined: 05 Feb 2007
Posts: 24

PostPosted: Sun 25 Mar '07 10:16    Post subject: Re: It's still the same... Reply with quote

rendezvous123 wrote:
fax wrote:
Add PHPIniDir "C:/php" to httpd.conf file (where php.ini is loacted in C:\php).

Not sure where to place that in httpd.conf, but i did do everything else in the instructions provided and it's all the same: No communication between PHP and MySQL.


Can you describe what you did and include any apache, php and mysql configuration files and error logs?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Sun 25 Mar '07 12:58    Post subject: Reply with quote

httpd.conf
Code:

LoadModule php5_module "c:/php5/php5apache2.dll"
AddHandler application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "c:/php5"


copy the libmysql.dll from mysql\bin to apache\bin
Back to top
rendezvous123



Joined: 24 Mar 2007
Posts: 4

PostPosted: Sun 25 Mar '07 13:44    Post subject: Problem fixed! Reply with quote

Okay, so the problem was that i didn't have
Code:
PHPIniDir "C:/PHP"
this little piece of code in my httpd.conf file.
Thanks for all of your help!
Back to top


Reply to topic   Topic: PHP 5.2.1 not communicating with MySQL 5.0.37 (Windows) View previous topic :: View next topic
Post new topic   Forum Index -> Other Software