Jump to content


Photo

*SOLVED* Problem installing MYSQL with PHP


  • Please log in to reply
10 replies to this topic

#1 klitscher

klitscher
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 07 July 2006 - 05:54 AM

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 extension=php_mysql.dll 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

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 07 July 2006 - 09:04 AM

This has been asked a few times and has been posted in the FAQ/Code Snippet Repository forum. Click here to read the thread.

That should be able to help you to get the mysql extension working.

#3 klitscher

klitscher
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 07 July 2006 - 01:50 PM

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 http://www.expertsrt...all-apache.html 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.

#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 07 July 2006 - 02:31 PM

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 Configuration File (php.ini) Path 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:
PHPIniDir "C:/php"
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 extension_dir setting is point to PHPs extension folder which stores all your extensions in. Also find display_startup_errors = off 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.

#5 klitscher

klitscher
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 07 July 2006 - 02:57 PM

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

#6 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 07 July 2006 - 04:13 PM

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 libmysql.dll, 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.

#7 klitscher

klitscher
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 07 July 2006 - 05:42 PM

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...

#8 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 07 July 2006 - 06:28 PM

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.

#9 klitscher

klitscher
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 07 July 2006 - 06:32 PM

okay, thanks....i'll let you know if I discover anything.

Ken

#10 klitscher

klitscher
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 08 July 2006 - 04:23 AM

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

#11 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 08 July 2006 - 11:45 AM

Okay. Glad you managed to sort it out. If you get any more problems or need help with your php scripts then please do come back and we'll help you out.

Also I'll mark this as solved for you.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users