SitePoint Sponsor |
|
User Tag List
Results 1 to 7 of 7
-
Dec 21, 2008, 07:46 #1
- Join Date
- Aug 2004
- Location
- Norway
- Posts
- 26
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Fatal error: Call to undefined function mysql_connect()
Hi, I'm a newbie, I followed the instruction from kevin's book (build your own database driven website 3rd edition) and installed PHP5.2.8, edited php.ini with extension_dir="c:\php\ext", uncommented extension=php_mysql.dll in php.ini under c:/windows
I installed mysql 5.0.67 using installer, played with the database using command prompt and everything seems working.
I am using IIS5.1, played with today.php to display today's date using php and everything seems fine.
The problem occurred when i use $dbcnx = mysql_connect('localhost', 'root', 'password'); the error displayed is Fatal error: Call to undefined function mysql_connect().
I ran phpinfo() and the extension_dir is correctly displayed as c:\php\ext, i check in the ext folder and php_mysql.dll do exist there. I can't seem to think of any reason that why php_mysql.dll cannot be loaded. when i tried php4 about four years ago i don't think i have this problem. Tried to check on the web and couldn't find any answer, wish someone here could help... Thx in advance.
-
Dec 21, 2008, 07:49 #2
- Join Date
- Mar 2008
- Posts
- 113
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Maybe the PHP that you downloaded doesn't come with mysql driver?
Search for the file from you php.ini: php_mysql.dll, maybe it is missing.
-
Dec 21, 2008, 07:54 #3
- Join Date
- Oct 2006
- Location
- Queensland, Australia
- Posts
- 852
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Check your php log and windows event viewer.
-
Dec 21, 2008, 08:08 #4
- Join Date
- Aug 2004
- Location
- Norway
- Posts
- 26
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
nothing in the windows event viewer, i think...
These errors are few hours before, not sure it's related or not..
C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt: ready for connections.
Version: '5.0.67-community-nt' socket: '' port: 3306 MySQL Community Edition (GPL)
TCP/IP has reached the security limit imposed on the number of concurrent TCP connect attempts.
i turned off skype so i dun think skype is an issue anymore.
Where is the php log actually?
-
Dec 21, 2008, 09:01 #5
- Join Date
- Jul 2006
- Posts
- 5
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Try xampp for windows.
XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl.
I can't post link, just google it.
-
Dec 21, 2008, 09:39 #6
- Join Date
- Jul 2008
- Posts
- 5,757
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You generally need to restart the webserver after making a change to php.ini(reboot)
Also, make sure you're modifying the correct php.ini. do a phpinfo() to find the path to one php is actually using.
-
Dec 21, 2008, 19:34 #7
- Join Date
- Aug 2004
- Location
- Norway
- Posts
- 26
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi, i finally decided to uninstall and install with the installer version and it seems to work now, i really dun understand computers sometimes, thx everyone for your precious time and advice!
Bookmarks