gilly914 Posted December 26, 2006 Share Posted December 26, 2006 Hey There,I just finished installing PHP on the Microsoft IIS platform... I know it is working ok, using the phpinfo(); test...I went on by installing MYSQL. I know the installation worked, because I use the MySQL Query Browser, and I created a test database.I tried making a test file just to test the MySQL.I can't even connect to the database...I dont know why... I wrote :$Connection = mysql_connect("localhost", "user", "pass") or die(mysql_error());The weird thing is that I don't get any error message...Does anyone have any idea what the problem can be??? or why it doesn't respon...?Thanks in Advance,Gilly914! Quote Link to comment Share on other sites More sharing options...
fenway Posted December 27, 2006 Share Posted December 27, 2006 That's strange... but what makes you think you aren't connected? Quote Link to comment Share on other sites More sharing options...
gilly914 Posted December 28, 2006 Author Share Posted December 28, 2006 Ok, Almost nobody answered my post and I don't know if it's because no one knows how to solve my problem or just because no one ever ran into this same problem...Well, after some research, I finally found out what was wrong. I decided to post this just incase someone might need it in the future...Here's what I did :First, I opened the php.ini file in the WINDOWS/system32 folder. I turned the "display_errors" parameter to On (Off by default).I then got an error message, something like : "Undefined function : mysql_connect()"I searched for it on google, php.net and mysql.com. I found out that because changes made in the newer version of PHP (PHP5), some changes need to be made to work with MySQL on IIS.The changes are :- Open php.ini again and uncomment the line : "extension=php_mysql.dll"- Copy the files php_mysql.dll and libmysql.dll to your WINDOWS/system32 folder.And thats it!!...Restart your computer, and it should work with no problem...You can turn the "display_errors" setting back to "Off" so you don't see all the unnessacery errors.I hope I helped some of you folks out there that one day will decide to install PHP and MySQL on the Microsoft IIS Platform... Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted December 28, 2006 Share Posted December 28, 2006 [quote author=gilly914 link=topic=119970.msg492675#msg492675 date=1167327716]Ok, Almost nobody answered my post and I don't know if it's because no one knows how to solve my problem or just because no one ever ran into this same problem...Well, after some research, I finally found out what was wrong. I decided to post this just incase someone might need it in the future...Here's what I did :First, I opened the php.ini file in the WINDOWS/system32 folder. I turned the "display_errors" parameter to On (Off by default).I then got an error message, something like : "Undefined function : mysql_connect()"I searched for it on google, php.net and mysql.com. I found out that because changes made in the newer version of PHP (PHP5), some changes need to be made to work with MySQL on IIS.The changes are :- Open php.ini again and uncomment the line : "extension=php_mysql.dll"- Copy the files php_mysql.dll and libmysql.dll to your WINDOWS/system32 folder.And thats it!!...Restart your computer, and it should work with no problem...You can turn the "display_errors" setting back to "Off" so you don't see all the unnessacery errors.I hope I helped some of you folks out there that one day will decide to install PHP and MySQL on the Microsoft IIS Platform...[/quote]Whenever you are developing scripts you should always turn on errors have set the error reporting to E_ALL or higher. You only turn display_errors off when you have finished development. Also I do have a thread in the FAQ/Code Snippet Repository about the undefined mysql function errors Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.