View Full Version : I am using PHP with MySQL
Complete
07-16-2009, 12:31 AM
I am using PHP with MySQL in IIS.
So, MySQL is no longer enabled by default, so the php_mysql.dll DLL must be enabled inside of php.ini. How is this done? I searched php.ini and I did not find php_mysql.dll.
Horus_Kol
07-16-2009, 07:04 PM
what version of PHP are you running?
search for 'extension=' in your php.ini - this should take you to about halfway down the file, and there is a list of extensions (mostly disabled) php_mysql.dll and php_mysqli.dll should both be there.
Complete
07-17-2009, 05:29 PM
I reinstalled php and in the new php.ini I found what you are talking about and I did find that line extension=php_mysql.dll (and I removed the semicolon to get it working). I did a few other things as well, like add C:\php to the system path and copied some library files to the system directory.
But now I have a new problem. The new problem I have is when I run a php file with
$con = mysql_connect('localhost', 'testuser', 'testpassword') or die("Could not connect");
The error I get in my browser says:
Fatal error: Call to undefined function mysql_connect() in C:\inetpub\wwwroot\getuser.php
Also, when I check my PHP info with a php file containing this line:
<?php phpinfo(); ?>
The page I get does not include any MySQL settings.
Please help!
Mandarin
07-17-2009, 07:38 PM
It sounds like you fixed php.ini and now it's just not finding the file php_mysql.dll. On my system, that file is in the directory c:\php\ext\ and it's referenced from within php.ini on the following lines:
; Directory in which the loadable extensions (modules) reside.
extension_dir = "c:\php\ext"
Make sure that the file exists and that your config file is pointing at the right extensions directory. Also, once you make changes to php.ini you need to restart your Apache server (or whatever webserver you're using) before the changes will be recognized.
Horus_Kol
07-19-2009, 10:01 PM
restart your Apache server (or whatever webserver you're using) before the changes will be recognized.
the PHP manual really doesn't make that clear enough, does it...
matthewm27
07-21-2009, 05:21 AM
This sounds like the exact problem I had before... You know what I did? I switched to Linux and installed a LAMP (Linux Apache MySQL PHP) sever, because in my experience, IIS is only good for ASP knowing that they are made by the same people.
Horus_Kol
07-22-2009, 06:54 PM
my last position - we ran IIS exclusively, as a lot of our bought-in applications required ASP/ASP.NET - although, we preferred PHP/MySQL for in house development....
in four years, I never really had any problem with PHP on IIS - and I have to say that neither Apache or IIS is a better choice than the other (both work very well, with a couple of small, but different, niggles) once you take the money factor out of the equation.
matthewm27
07-23-2009, 04:54 AM
my last position - we ran IIS exclusively, as a lot of our bought-in applications required ASP/ASP.NET - although, we preferred PHP/MySQL for in house development....
in four years, I never really had any problem with PHP on IIS - and I have to say that neither Apache or IIS is a better choice than the other (both work very well, with a couple of small, but different, niggles) once you take the money factor out of the equation.
Well I just couldn't get IIS to work! I think you were one of the ones trying to help me, and I just gave up.
P.S. Although you're right, Apache did have problems as well.
vBulletin® v3.6.7, Copyright ©2000-2010, Jelsoft Enterprises Ltd.