Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Fatal error: Call to undefined function mysql_connect()

20 views
Skip to first unread message

cglo...@hotmail.com

unread,
Jul 7, 2008, 6:02:18 PM7/7/08
to
Here is the output from phpinfo() on my laptop running windows vista.
As you can see mysql is mentioned several times in the output. I'm
not sure why i get this error. Php scripts that i save in the htdocs
folder seem to work as long as mysql is not called. Any ideas?
Thanks

System Windows NT ELMEU 6.0 build 6001
Build Date May 2 2008 18:01:20

Configure Command cscript /nologo configure.js "--enable-snapshot-
build" "--with-gd=shared" "--with-extra-includes=C:\Program Files
(x86)\Microsoft SDK\Include;C:\PROGRA~2\MICROS~2\VC98\ATL\INCLUDE;C:
\PROGRA~2\MICROS~2\VC98\INCLUDE;C:\PROGRA~2\MICROS~2\VC98\MFC\INCLUDE"
"--with-extra-libs=C:\Program Files (x86)\Microsoft SDK\Lib;C:
\PROGRA~2\MICROS~2\VC98\LIB;C:\PROGRA~2\MICROS~2\VC98\MFC\LIB"
Server API Apache 2.0 Handler
Virtual Directory Support enabled
Configuration File (php.ini) Path C:\Windows
Loaded Configuration File C:\php\php.ini
PHP API 20041225
PHP Extension 20060613

Apache Version Apache/2.2.9 (Win32) PHP/5.2.6
Apache API Version 20051115
Server Administrator ad...@hsd1.state.comcast.net
Hostname:Port 127.0.0.1:0
Max Requests Per Child: 0 - Keep Alive: on - Max Per Connection: 100
Timeouts Connection: 300 - Keep-Alive: 5
Virtual Server No
Server Root C:/Program Files/Apache Software Foundation/Apache2.2
Loaded Modules core mod_win32 mpm_winnt http_core mod_so mod_actions
mod_alias mod_asis mod_auth_basic mod_authn_default mod_authn_file
mod_authz_default mod_authz_groupfile mod_authz_host mod_authz_user
mod_autoindex mod_cgi mod_dir mod_env mod_include mod_isapi
mod_log_config mod_mime mod_negotiation mod_setenvif mod_php5

PHP_SELF /test.php
_SERVER["HTTP_HOST"] 127.0.0.1
_SERVER["HTTP_USER_AGENT"] Mozilla/5.0 (Windows; U; Windows NT 6.0; en-
US; rv:1.9) Gecko/2008052906 Firefox/3.0
_SERVER["HTTP_ACCEPT"] text/html,application/xhtml+xml,application/
xml;q=0.9,*/*;q=0.8
_SERVER["HTTP_ACCEPT_LANGUAGE"] en-us,en;q=0.5
_SERVER["HTTP_ACCEPT_ENCODING"] gzip,deflate
_SERVER["HTTP_ACCEPT_CHARSET"] ISO-8859-1,utf-8;q=0.7,*;q=0.7
_SERVER["HTTP_KEEP_ALIVE"] 300
_SERVER["HTTP_CONNECTION"] keep-alive
_SERVER["PATH"] C:\Windows\system32;C:\Windows;C:\Windows
\System32\Wbem;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:
\Acer\Empowering Technology\eDataSecurity\;C:\Acer\Empowering
Technology\eDataSecurity\x86;C:\Acer\Empowering Technology
\eDataSecurity\x64;C:\Program Files\MySQL\MySQL Server 5.0\bin
_SERVER["SystemRoot"] C:\Windows
_SERVER["COMSPEC"] C:\Windows\system32\cmd.exe
_SERVER["PATHEXT"] .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
_SERVER["WINDIR"] C:\Windows
_SERVER["SERVER_SIGNATURE"] no value
_SERVER["SERVER_SOFTWARE"] Apache/2.2.9 (Win32) PHP/5.2.6
_SERVER["SERVER_NAME"] 127.0.0.1
_SERVER["SERVER_ADDR"] 127.0.0.1
_SERVER["SERVER_PORT"] 80
_SERVER["REMOTE_ADDR"] 127.0.0.1
_SERVER["DOCUMENT_ROOT"] C:/Program Files/Apache Software Foundation/
Apache2.2/htdocs
_SERVER["SERVER_ADMIN"] ad...@hsd1.state.comcast.net
_SERVER["SCRIPT_FILENAME"] C:/Program Files/Apache Software Foundation/
Apache2.2/htdocs/test.php
_SERVER["REMOTE_PORT"] 49894
_SERVER["GATEWAY_INTERFACE"] CGI/1.1
_SERVER["SERVER_PROTOCOL"] HTTP/1.1
_SERVER["REQUEST_METHOD"] GET
_SERVER["QUERY_STRING"] no value
_SERVER["REQUEST_URI"] /test.php
_SERVER["SCRIPT_NAME"] /test.php
_SERVER["PHP_SELF"] /test.php
_SERVER["REQUEST_TIME"] 1215467590

Jerry Stuckle

unread,
Jul 7, 2008, 8:26:59 PM7/7/08
to

You don't have the MySQL extension loaded. Either it's not being loaded
in your php.ini file, or if it is, the MySQL client libraries are not
available when the PHP code is loaded.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstu...@attglobal.net
==================

burgerm...@gmail.com

unread,
Jul 8, 2008, 9:13:02 AM7/8/08
to

It looks as though you have the mysql directory in your include path,
but you do not have the mysql extension for PHP installed. Check this
link out for all the info you need to get it setup:

http://us3.php.net/manual/en/mysql.installation.php

Hopefully the fact that you're running Vista won't cause you any
additional complications, as I understand that new OS has caused all
kinds of software anomalies.

petersprc

unread,
Jul 8, 2008, 1:19:02 PM7/8/08
to
Hi,

Try commenting out this line in c:\php\php.ini and restarting:

extension=php_mysql.dll

DS

unread,
Jul 8, 2008, 10:15:38 PM7/8/08
to
For PHP 5.x try the MySQL Improved Extension "mysqli"
You call mysqli_init() followed by mysqli_real_connect()

=================================================

cglo...@hotmail.com

unread,
Jul 9, 2008, 7:22:15 AM7/9/08
to
Thanks for the quick responses. I'll try the solutions and let you
all know.

0 new messages