php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38954 PHP cannot connect with MySQL/MySQLi
Submitted: 2006-09-25 17:46 UTC Modified: 2006-10-11 22:09 UTC
Votes:2
Avg. Score:3.0 ± 2.0
Reproduced:1 of 2 (50.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: akaraethon at gmail dot com Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.1.6 OS: Windows Server 2003 32bit
Private report: No CVE-ID: None
 [2006-09-25 17:46 UTC] akaraethon at gmail dot com
Description:
------------
I have PHP running on Win server ent. ed. 2k3, IIS is my webserver with MySQL as my DB engine, MySQL runs fine, but for some reason PHP cannot connect. I used the PHP.ini-Recomended file, enabled php_mysql.dll, and set up the other basics (webserver root, etc). PHP runs fine, IIS serves pages fine, but any attempt to connect to mysql fails with the error "Fatal error: Call to undefined function mysql_connect() in C:\Inetpub\wwwroot\Dragon-Radio\test.php on line 5" I have checked, double checked, tripple checked, and done a complete erase and reinstall of PHP and MySQL, all files are in the correct places, but php just will not connect...


Reproduce code:
---------------
URL to page that exemplifies error http://dragon-radio.selfip.net

Expected result:
----------------
PHP should not tell me there is an error

Actual result:
--------------
Fatal error: Call to undefined function mysql_connect() in C:\Inetpub\wwwroot\Dragon-Radio\test.php on line 5

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-25 20:57 UTC] tony2001@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 [2006-09-25 22:48 UTC] akaraethon at gmail dot com
Well then where is the problem comming from? I HAVE followed ALL the instructions for setup on IIS and MySQL is running fine, so if this isnt a bug then why is it happening?
 [2006-09-25 22:55 UTC] bjori@php.net
www.php.net/mysql

"MySQL is no longer enabled by default, so the 
php_mysql.dll DLL must be enabled"...

 [2006-09-26 01:31 UTC] akaraethon at gmail dot com
Ok, are you not READING what I write? In my very first post I said I have enabled the DLL file, but PHP will not connect. so why don't we do this, instead of just changing this to bogus (again) lets figure out whats going on, and see if we cant come toan agreement as to the status, if you think its bogus then tell me what to do.
 [2006-09-26 07:09 UTC] tony2001@php.net
Still not PHP problem.
And I don't see any reasons to post parts of the docs here, it's not a forum.
 [2006-09-26 18:08 UTC] akaraethon at gmail dot com
Fine, you are right its not a forum, for some ODD reason I couldnt find even one forum out there devoted to PHP, and If I were a newbie, and not someone who has worked with PHP since PHP2.0 I might agree that I just made a config mistake, but I have, I didnt and I still think this may be some sort of problem with PHP not liking something.
 [2006-09-26 18:20 UTC] tony2001@php.net
There is detailed description of what should be done in order to enable MySQL support in PHP: http://php.net/mysql
 [2006-09-26 18:38 UTC] akaraethon at gmail dot com
wow I NEVER knew that was ther, I mean its not like I EVER have used PHP 5.0 and MySQL together, I mean like whoa who would have thought they worked together?

again, as stated in my first post I ALREADY READ THAT!
 [2006-10-03 19:20 UTC] akaraethon at gmail dot com
Well I have done some more testing and I have pinpointed the problem, no matter what I do to the php.ini file, PHP ignores it. To test this I went into the ini file and changed safemode to on, but after a restart, phpinfo still has it listed as off, as well as a few other things i have noticed, like the ext directory is set to "c:\php5" but in the ini file it is set to "c:\php\ext". I dont understand why this is, but if I had to guess I would think that PHP was using a built in ini file. so now can you still tell me this is bogus? and if so what am I to do then?
 [2006-10-04 02:54 UTC] akaraethon at gmail dot com
Everyone I've talked to says this has to be a bug, or an error in the 5.1.6.6 build, I'm not new to PHP/MySQL, I've been at it since PHP was 2 I know what I am doing, take a look at http://dragon-radio.selfip.net for yourself, you will see on the page itself my phpinfo output as well as my entire current PHP.ini file (no its not copy and pasted its generated with the folowing code echo "<br/><br/><pre>";
ob_start();
  readfile('c:\php5\php.ini');
  $data = ob_get_contents();
  ob_end_flush();
echo"</pre>";) you can see for yourself that I have everything in there right, but PHP is ignoring it.
 [2006-10-04 09:01 UTC] edink@php.net
php.ini should be placed in d:\windows as you can see from that phpinfo() page.
 [2006-10-04 11:44 UTC] akaraethon at gmail dot com
nope, no good, now PHP wont start at all. all page requests now come back 404. its not a misconfiguration, there is something else wrong.
 [2006-10-04 12:07 UTC] akaraethon at gmail dot com
Well I think we just discovered a clue, when I MOVED php.ini to the d:\Windows, php failed, when I COPIED php.ini back to c:\PHP5 php still failed to start, but once I DELETED the php.ini file in d:\Windows PHP Started fine, but still isn't reading the ini info...
 [2006-10-04 12:37 UTC] tony2001@php.net
All error messages are in your Apache error_log.
The fact that you're unable to put libmysql.dll in you PATH and copy appropriate php.ini to c:\windows is definitely NOT PHP problem.

 [2006-10-11 20:30 UTC] akaraethon at gmail dot com
Well to Update this, I have switched to apache and WITHOUT CHANGING ANYTHING IN PHP.INI it works fine, straight away. so now again, I tell you there is a bug in php, I suspect is has something to do with the php5isapi.dll, you might want to check into it, instead of just saying I made a mistake.
 [2006-10-11 21:08 UTC] akaraethon at gmail dot com
Ok, I AM NOT the only one expiriencing this issue, see bug #30231 he is having the exact same problems I am.
 [2006-10-11 21:13 UTC] derick@php.net
Please, this is not a forum. Stop wasting our time with something you were doing wrong before.
 [2006-10-11 21:20 UTC] akaraethon at gmail dot com
I am not doing anything wrong, how is it wasting your time telling you that there is a problem with how PHP and IIS interact? everything worked fine in pre v5 versions. and you want to talk about wasting time? I had to convert my entire webserver to work with apache! I do not like having to go in and edit .conf files everytime I want to make a change, I LIKE GUI's and apache doesnt have one!
 [2006-10-11 22:09 UTC] pajoye@php.net
Only to confirm that using IIS with php and mysql or mysqli works very well. I just tested a fresh 5.2 snapshot and another using 5.1.6.

akaraethon, I'm sorry if you don't have a gui for apache, but it is not a PHP bug or problem. However we have mailing lists to help our users with their installation problems or to let them ask any kind of 1st level support. Please use them:

http://www.php.net/mailing-lists.php

Thanks for your understanding and please leave this bug closed now (bogus).

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 14:01:34 2025 UTC