Author Topic: Unable to connect to mysql database from php using apache on xp pro  (Read 1337 times)

0 Members and 1 Guest are viewing this topic.

Offline JohnMikeTopic starter

  • Irregular
  • Posts: 8
    • View Profile
Dear All,
I have read the posts on this site, instructions on php.net and mysql.com and Paul Dubois MySql and I have to declare myself stuck. I have installed php and apache on c: and have been using this for 2 years without issue.
I have installed mysql on f:drive to keep database data separate. When I try to connect I get HTTP500 Internal Server Error. I have updated the php.ini to allow the appropriate extensions. I have installed the mysql c connector. I can access the database from the htdocs therefore I am assuming that the server user/group can access the mysql files. Any assistance would be gratefully received.
Regards JohnMike

Offline JohnMikeTopic starter

  • Irregular
  • Posts: 8
    • View Profile
Re: Unable to connect to mysql database from php using apache on xp pro
« Reply #1 on: March 12, 2010, 06:35:43 AM »
Hi All,

Some additional information - I have updated to php 5.3 which the documentation states should include the native driver mysqlnd and remove the need to install the extension, However when I run a connect it errors saying the mysqli cannot be found - which is true it can't. So how are you meant to invoke the mysqli commands??

Regards

Offline PFMaBiSmAd

  • Guru
  • 'Insane!'
  • *
  • Posts: 14,588
  • In Coding, Automatic means you write code to do it
    • View Profile
Re: Unable to connect to mysql database from php using apache on xp pro
« Reply #2 on: March 12, 2010, 06:40:50 AM »
The php5.3 native driver is just the driver. You still need to enable the mysql or mysqli extension.
Signature: (not a comment about anything you posted unless specifically indicated)
Debugging step #1: To get past the garbage-out equals garbage-in stage in your code, you must check that the inputs to your code are what you expect.

Programming is just problem solving, but it is done in another language. You must learn enough of the programming language you are using to be able to read and write code.

Offline JohnMikeTopic starter

  • Irregular
  • Posts: 8
    • View Profile
Re: Unable to connect to mysql database from php using apache on xp pro
« Reply #3 on: March 12, 2010, 06:52:06 AM »
Hi PFMaBiSmAd,

Yes indeed. It has just dawned on me that after upgrading to 5.3 I updated the new php.ini for the appropriate extensions but not extension_dir. so it could not find php_mysql_dll which I think is the missing link. I do now have a connection to the data base.

Thanks for the inspiration!