| Author |  | 
| rendezvous123 
 
 
 Joined: 24 Mar 2007
 Posts: 4
 
 
 | 
|  Posted: Sat 24 Mar '07 13:41    Post subject: PHP 5.2.1 not communicating with MySQL 5.0.37 (Windows) |   |  
| 
 |  
| 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.
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:▪ Set extension_dir =  to point to my PHP extension directory.
 ▪ Placed libmysql.dll from my Mysql/bin folder to C:/windows.
I'm not sure what else needs to be done for this to work. Any help would be highly appreciated!▪ 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.
  |  | 
| Back to top |  | 
| Steffen Moderator
 
 
 Joined: 15 Oct 2005
 Posts: 3130
 Location: Hilversum, NL, EU
 
 | 
|  Posted: Sat 24 Mar '07 14:33    Post subject: |   |  
| 
 |  
| When you run mysqlinfo.zip from the download page, what happens? 
 Steffen
 |  | 
| Back to top |  | 
| rendezvous123 
 
 
 Joined: 24 Mar 2007
 Posts: 4
 
 
 | 
|  Posted: Sun 25 Mar '07 4:10    Post subject: |   |  
| 
 |  
| 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
 
 
 | 
|  Posted: Sun 25 Mar '07 5:54    Post subject: |   |  
| 
 |  
| 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
 
 
 | 
|  Posted: Sun 25 Mar '07 9:05    Post subject: It's still the same... |   |  
| 
 |  
|  	  | 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
 
 
 | 
|  Posted: Sun 25 Mar '07 10:16    Post subject: Re: It's still the same... |   |  
| 
 |  
|  	  | 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: 7442
 Location: EU, Germany, Next to Hamburg
 
 | 
|  Posted: Sun 25 Mar '07 12:58    Post subject: |   |  
| 
 |  
| 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
 
 
 | 
|  Posted: Sun 25 Mar '07 13:44    Post subject: Problem fixed! |   |  
| 
 |  
| Okay, so the problem was that i didn't have  this little piece of code in my httpd.conf file. Thanks for all of your help!
 |  | 
| Back to top |  |