MySQL and PHP5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



OK, so I see quite a few people having this problem, but I don't yet see a 
solution that worked for someone else be something I haven't already tried 
or have configured.

I'm getting a Fatal Error when I try to connect to MySQL through PHP.

Fatal error: Call to undefined function mysql_connect()

1.) I have PHP 5.2.6 installed at: C:\php\
2.) I have edited my php.ini so that the extensions_dir is set: 
extension_dir = "c:\php\ext"
3.) I have edited my php.ini so that the line for the php_mysql.dll 
extension is not commented:
extension=php_mysql.dll
(The only other extension that is enabled is: extension=php_dbg.dll-5.2.1)
4.) I am able to use PHP in Apache 2.2, and I am able to start and use MySQL 
through the MySQL CLI.
5.) My php_mysql.dll file is in c:\php\ext
6.) My libmysql.dll is in c:\php
5.) My path statement is:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program 
Files\Network Associates\PGPNT;C:\MySQL\bin;c:\php\;c:\php\ext\;C:\Program 
Files\Microsoft SQL
Server\90\Tools\binn\

However, the results of my phpinfo() do not show a MySQL section (I don't 
know if there should be one, I'm new to this). The only place MySQL shows up 
is in path variables for the various sections (ie, Apache Environment --  
Path variable). And I get the above error message when I try to connect to 
my database. Here is the syntax:

$connect = mysql_connect("localhost", "root", "password") or die ("Error 
message text.");

Is there something I am missing? I had heard that you need to compile php 
yourself if you want MySQL. Is this true, and is this why I don't see a 
MySQL section to the phpinfo() output?
PHP 5.2.6 (simple file extract from download into c:\php directory)
Apache 2.2.9
MySQL 5.0.67 (from Windows Install version)


Thanks in advance,

Tim R. 



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux