Jump to content

*SOLVED* Problem installing MYSQL with PHP


Recommended Posts

Hey all,

I have installed Apache/PHP5 and Mysql from scratch and have apache and php5 working well.  It's installed on an XP box used just for development. I'm able to serve up phpinfo fine.  I am also able to use mysql to run on the command line.  I've uncommented [b]extension=php_mysql.dll[/b] in php.ini but I can't for the life of me get phpinfo to show the mysql info.  I'm able to manipulate the php.ini file to change other extensions, but not mysql or mysqli, and the dll's are in the right spot.  Any help?  I wish i could show you, but like i said, it's a development machine and not online.  Thanks in advance.

Ken
Link to comment
Share on other sites

This has been asked a few times and has been posted in the FAQ/Code Snippet Repository forum. [url=http://www.phpfreaks.com/forums/index.php/topic,95378.0.html]Click here[/url] to read the thread.

That should be able to help you to get the mysql extension working.
Link to comment
Share on other sites

Thanks for the help, but I've already done everything as that example says (well, mostly...I've just added my php location to PATH rather than moving everything to c:\windows)...still no luck...any other thoughts?

Ken

EDIT: FWIW, I followed [url=http://www.expertsrt.com/tutorials/Matt/install-apache.html]http://www.expertsrt.com/tutorials/Matt/install-apache.html[/url] these instructions to the t to get this all set up...everything else works great, and the install directory is exactly the same as these instructions.
Link to comment
Share on other sites

OKay when you added PHP to the path variable you did restart your PC. If havnt restarted your PC then the new variable wont be available until Windows has been restarted.

Also verify that PHP is using the correct php.ini too, by running the phpinfo function. Check that [b]Configuration File (php.ini) Path[/b] is pointing to the correct folder in which your php.ini file is located in. If PHP is not pointing to the correct php.ini file then, Add the following line:
[code]PHPIniDir "C:/php"[/code]
Change C:/php to the correct folder location in which the php.ini file is located in. Restart Apache and check that php is using the correct php.ini file.

If it is using the correct php.ini and mysql extension still isn't loaded, Check that the [b]extension_dir[/b] setting is point to PHPs extension folder which stores all your extensions in. Also find [b]display_startup_errors = off[/b] and change off to on. Save your php.ini and restart Apache. If PHP is having any trouble loading up it should popup a little error message with whats wrong.
Link to comment
Share on other sites

Okay, I had everything set right with the php.ini file, but when I changed the display startup errors line i did receive a bunch of errors that say:

PHP Startup: Unable to load dynamic library 'D:\Web\WebServer\PHP\ext\php_mysql.dll' - The specified procedure could not be found.

However, when I look in that directory for that file (as well as the 10 others that are giving me the same message because I uncommented all the extensions) that file is located in that directory.  This does not happen for all of the extensions though, so I'm at a loss for what to do next.  Thanks for your continued help!

Ken
Link to comment
Share on other sites

This can happen when extensions are either not compatible with the current version of PHP. Or the extension requires other files in order for them to work. For example the mysql extension requires a file call [b]libmysql.dll[/b], this file should be located in the root of the PHP folder. Now if the PHP folder is in the path, PHP should be able to pick this file up automatically.

For now just enable two extensions, suhc as GD2 and MySQL and copy libmysql.dll file to your WINDOWS folder. Restart Apache. Does PHP now load up the extension.
Link to comment
Share on other sites

I have enabled GD2 and MySQL, have libmysql.dll in the root php folder which was defined in PATH, as well as in C:\WINDOWS and restarted Apache.  Still have the same problem.  I get the startup error twice, both times for php_mysql.dll  Did not receive an error for GD2.  Any other thoughts...thanks for taking the time to help me out...
Link to comment
Share on other sites

Man this is wierd! Usually adding the php folder to the path solves this or moving the libmysql.dll file to the WINDOWS folder. Sometimes PHP can be a little bit picky, and it gets annoying. I am out of suggestions. The only thing I can suggest is to double check everything and that you havn't made any typos for setting the PATH variable, uncommented the cortrect lines.

Also I had a read through the tutorial you linked to and that is fine, everything said in that tutorial is what I do when I setup Apache, PHP and MySQL.
Link to comment
Share on other sites

Okay...figured out...there was another version of libmysql.dll in system32 from when I installed sokkit...apparently when you uninstall sokkit it does not remove these...so all is good...thanks for all your help...I appreciate it (how do you mark this as solved?)

Thanks
Ken
Link to comment
Share on other sites

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.