Jump to content

configuring php to run with mysql


Recommended Posts

hey hows everyone doing.....heres my dilemma i have just finished installing apache 1.3 and php5 on to my comp. i configured it all and those two work but i installed mysql and it installs properly but i cant for the life of me configure it to be recognized by php....here is what i have tried so far...1.gone into the path variable and made the path go to I:/php/

2. I have gone into the php.ini which has been renamed from php.dist.ini and put into my windows system 32 and windows dir's, as well as the php directory

3. In the php.ini file i uncommented the php_mysql.dll,php_mysqli.dll and php_mbstring.dll, as well as stating the extension directory as "I:/php/ext"

4.Ive tried installing phpmyAdmin and when i go to run it it says cannot load php_mysql.dll which is weird because ive tried putting both the libmysql.dll and the php_mysql in the main php dir as well as the system 32 and the windows dir.....I mean i have been on numerous sites explaining how to do it and ive tried everything i can possibly think of.....so if anyone has any ideas as to what i am doing wrong then please let me know thankyou.

 

ps. I do not have iis on my computer im running windows xp home

Link to comment
Share on other sites

Ok before you continue can you move all files you have moved out of the PHP folder back into PHP folder. The number one rule is never move any files out of the PHP folder. Always keep them where they are. When you add PHP to PATH, PHP can see everything in I:/php so no need to move anything. Moving files around can complicate things even more, especially if you are going upgrade PHP. Also when you have setup the PATH make sure you have restarted Windows - that is a very important step.

 

The next thing you should do is uncomment php.ini-recommended in I:/php and then create a test.php file with the following code:

<?php
phpinfo();
?>

Save it where you save all your other php files to. Run it and make sure it is using the php.ini in I:/php/ (look for the Configuration File (php.ini) Path or Loaded Configuration File line is pointing to I:/php/php.ini)

 

If it is you can now configure PHP to enable the mysql extension(s). To do so open up the php.ini and setup the extension_dir directive to point to "I:/php/ext" and remove the semi-colon in front of extension=php_mysql.dll and extension=php_mysqli.dll lines.

 

Save the php.ini and restart your http server (Apache, IIS etc). Re run test.php make sure it reports the changes you have just made by searching for extension_dir and making the sure the values is set to is I:/php/ext and that when you search for mysql or mysqli there is sperate heading/sub-section for each of them.

 

If you can see the changes you have made in php.ini being reported by phpinfo() then PHP is now setup.

 

When setting up PHP you should not do it all in one go. Always do it one step at a time and checking that every step you do works. I know I have  said this before but never move any files out of the PHP folder especially if you have added the PHP folder to the PATH. If you do move  a file make sure you cut and paste and not copy and paste. Having multiple copies of the same file can complicate things even more.

 

NOTE: Make sure you have downloaded the zipped binaries package and not the installer.

Link to comment
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.