ID: 45338 Comment by: tpeterson at americaschoice dot org Reported By: tpeterson at americaschoice dot org Status: Assigned Bug Type: Dynamic loading Operating System: Windows NT PHP Version: 5.2.6 Assigned To: jmetric New Comment:
I searched for all old mysql .dll files as the documentation said and for all .ini files. I deleted any old ones. I restarted--the computer and the server. I did this sooooo many times. I was as thorough with this as possible. Also, during the class that I taught, this was the first install as this was the first PHP class. It wasn't just me and my laptop. I also used a work laptop. It was all the students in that class. Even students who did this at home with your installer, after the class was over, couldn't get it to work. So this is not an old ini issue. The ini that was used was the one that your installer set up. And as I said the ini that your installer installed on the systems had everything uncommented. If MySQL, for instance, is not supported why was everything, including the MySQL extension uncommented upon a base install? First install? Anyway, I already thought of this and verified the ini used was the one that I was edited. I will find yet another clean laptop and install the WAMP stack on it with this installer and see if there is still an issue. Previous Comments: ------------------------------------------------------------------------ [2008-07-02 11:43:52] [EMAIL PROTECTED] It just means that PHP is actually using different (old?) php.ini file than the one you're editing. Check from phpinfo() output what the actual _loaded_ php.ini file is. ------------------------------------------------------------------------ [2008-06-29 15:01:48] tpeterson at americaschoice dot org Yes, I know. The file is there, as I said in my write-up. It still won't work. ------------------------------------------------------------------------ [2008-06-29 11:13:57] simonclur at gmail dot com PHP v5.2.6 requires to the php_mysql.dll (v5.2.6) dll to connect to MySql. It appears the PHP v5.2.6 .msi installation package apparently does not copy the new php_mysql.dll into the ./ext directory as it is supposed to. Download the .zip version of php v5.2.6 and copy the php_mysql.dll file from the zip archive to your /php/ext folder and make sure the following line in your php.ini file is uncommented. extension=php_mysql.dll If you're having problems with "Unable to initialize module" for php_mysql.dll then you have copied an incorrect version from a previous or later release of php. The php_mysql.dll file properties should show the following version information for the dll: File version: 5.2.6 Created: 11 January 2006 18h15 ------------------------------------------------------------------------ [2008-06-23 17:54:13] tpeterson at americaschoice dot org Description: ------------ I have installed Apache 2.2.9, PHP 5.2.6, and MySQL 5.0 on Windows. PHP and Apache work. PHP and MySQL do not. But, MySQL does work on its own. I used the PHP installer for php.net downloads page. I keep getting the Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\processex.php on line 15 error when I try to connect to my MySQL database from a PHP script. I did the following: 1) Installed Apache, PHP, and MySQL 2) Ensured that I can run a PHP with built-in functions and display it in my browser with Apache serving it up. 3) Log into MySQL and create a database. 4) Located the extensions path my php.ini file and ensured that my .dlls were in it 5) Located the mysql extension statements in the php.ini file and uncommented them (removed the semicolon before each of them EVEN THOUGH THE MYSQL ONES WERE ALREADY UNCOMMENTED IN THIS DOWNLOAD ALTHOUGH YOU SAY THERE IS NOT BUILT IN SUPPORT). 6) Ensured that both PHP and MySQL have entries in the System Path. 7) Restarted the server 8) Restarted my computer. I got the same error. I looked at the phpinfo() and used get_loaded_extensions() function output but saw that mysql is not installed. Then I did what the documentation in several places on the internet said to do: I deleted all the libmysql.dll and php_mysql.dll files except the ones in the php directory and then copied them to the windows/system32 directory and restarted my computer. I still get the same error message. Still do not see mysql installed with the phpinfo() or get_loaded_extensions(). I then did the following, which is what another user suggested: Download the PHP zip distribution and copy the .dlls out of that into my php directory that the installer installed. No luck. I still get the same error message.Still do not see mysql installed with the phpinfo() or get_loaded_extensions(). I also tried to load php_mysql.dll with the dl() function but no luck as I am using a multi-threaded server. Someone on the internet said to try deleting the php_mysql.dll and libmysql.dll and using the ones from MySQL. I just checked and mysql is only offering mysqli and a replacement for libmysql which I do not want to get into just yet. I can get this installed (WAMP) and working if I use, for example, xampp. So this tells me there is something wrong with your PHP code/documentation. I am not the only one who has tried. I was teaching a class and all the students tried individually at school and at home with no luck. I tried this on my Windows XP and Windows NT laptops. Nothing. Reproduce code: --------------- // we connect to example.com and port 3307 $link = mysql_connect('localhost', 'root', 'password'); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; mysql_close($link); Expected result: ---------------- That I get "Connected successfully" and that the MySQL PHP module shows up in the phpinfo() page. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45338&edit=1