469,303 Members | 1,949 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,303 developers. It's quick & easy.

No mysql when running phpinfo.PHP???

Hi

I am a newbie and was just getting started working on a guestbook
tutorial when I got an error message upon running my PHP code:

Fatal error: Call to undefined function mysql_connect() in C:\Program
Files\Apache Group\Apache2\htdocs\add.php on line 6

So I searched the web for hours trying stuff to no avail. I think
something needs to be copied/pasted from a directory to another or
something needs to be enabled in php.INI. But what?

When I run localhost/phpinfo.PHP there is no mention of Mysql, I know
it should be in there.

I am running Windows XP pro/Apache server/PHP 5/Mysql.
Mysql works fine at the prompt, I create, delete tables and databases
at will.

One more point I do have the libMySQL.dll in C:\WINDOWS\SYSTEM32.

I hope someone can help me

Thanks a lot

Patrick
Jul 17 '05 #1
10 10943
You have to enable the mysql extension in your php.ini file. Seek out the
entry which says ';extension=php_mysqli.dll' and remove the leading
semi-colon.

--
Tony Marston

http://www.tonymarston.net

"Patrick" <va******@netzero.net> wrote in message
news:a3**************************@posting.google.c om...
Hi

I am a newbie and was just getting started working on a guestbook
tutorial when I got an error message upon running my PHP code:

Fatal error: Call to undefined function mysql_connect() in C:\Program
Files\Apache Group\Apache2\htdocs\add.php on line 6

So I searched the web for hours trying stuff to no avail. I think
something needs to be copied/pasted from a directory to another or
something needs to be enabled in php.INI. But what?

When I run localhost/phpinfo.PHP there is no mention of Mysql, I know
it should be in there.

I am running Windows XP pro/Apache server/PHP 5/Mysql.
Mysql works fine at the prompt, I create, delete tables and databases
at will.

One more point I do have the libMySQL.dll in C:\WINDOWS\SYSTEM32.

I hope someone can help me

Thanks a lot

Patrick

Jul 17 '05 #2
there looks has some problems for PHP5 work with MYSQL. I still have
the same problem about the PHP5. try PHP4 first.
I tried PHP4, and it working stable.

Jul 17 '05 #3
I am using PHP 5.0.2 with MySQL 4.1.7 and Apache 2.0.52 on a Windows XP PC
without any problem. The MySQL client shows up as 4.1.3-beta.

--
Tony Marston

http://www.tonymarston.net

<ze******@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
there looks has some problems for PHP5 work with MYSQL. I still have
the same problem about the PHP5. try PHP4 first.
I tried PHP4, and it working stable.

Jul 17 '05 #4

Tony Marston wrote:
You have to enable the mysql extension in your php.ini file. Seek out the entry which says ';extension=php_mysqli.dll' and remove the leading
semi-colon.


Tony

First-off thanks for taking the time to help, I really appreciate it.
The extension you mention isn't in my php.ini file and I checked both
since I have a "php.ini" in the C:Windows and another called
"php.ini-recommended" in the PHP 5 folder.
They appear identical. Here is pasted the extension section of the
php.ini file located in C:windows:

<Pasted starts>

;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
;
; If you wish to have an extension loaded automatically, use the
following
; syntax:
;
; extension=modulename.extension
;
; For example, on Windows:
;
; extension=msql.dll
;
; ... or under UNIX:
;
; extension=msql.so
;
; Note that it should be the name of the module only; no directory
information
; needs to go here. Specify the location of the extension with the
; extension_dir directive above.
;Windows Extensions
;Note that ODBC support is built in, so no dll is needed for it.
;

;extension=php_bz2.dll
;extension=php_cpdf.dll
;extension=php_curl.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_dbx.dll
;extension=php_exif.dll
;extension=php_fdf.dll
;extension=php_filepro.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_iconv.dll
;extension=php_ifx.dll
;extension=php_iisfunc.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
;extension=php_mbstring.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
;extension=php_mssql.dll
;extension=php_msql.dll
;extension=php_mysql.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_oracle.dll
;extension=php_pdf.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_sockets.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_w32api.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
;extension=php_yaz.dll
;extension=php_zip.dll

<Pasted ends>

I have tried several goofy things as sometimes it's like the lotto you
get lucky, but to no avail.

What I tried:

-I tried to change "extension=php_mysql.dll" to
"extension=php_mysqli.dll" with semi-colon removed, restarted apache
got error message saying unable to start dynamic library.
-Went into my PHP 5 folder and copied the "libmysqli.dll" file to
C:windows/system32, restarted apache got error message. Left the
"libmysqli.dll" in system 32 and added "extension=php_mysqli.dll" to
php.ini, restarted apache, error message again.

I hope the kind help keeps on coming, I think I am close.
Thanks again

Patrick

Jul 17 '05 #5

Hi again

This is the original poster again. I was just searching the web for
help on my problem (I must be on 5 hours on this now!) and something
keeps on poping up here and there but I don't know how to implement it
if that's my solution.
It seems the dynamic extension section of the "php.ini" file needs a
line like the following:

extension_dir="C:\PHP5\ext\"

My php.ini doesn't have one. Could that be it? I saw it mentionned
twice in answers to poster's problems on various forums.

My php extensions folder directory is:

C:\php-5.0.0-Win32\ext

I of course tried several of those "extension_dir" lines to no avail
after restarting Apache.

Thanks again

Patrick

Jul 17 '05 #6
On Mon, 6 Dec 2004 18:12:34 -0000
"Tony Marston" <to**@NOSPAM.demon.co.uk> wrote:

:I am using PHP 5.0.2 with MySQL 4.1.7 and Apache 2.0.52 on a Windows XP PC
:without any problem. The MySQL client shows up as 4.1.3-beta.

I'd be interested in knowing what packages you down-loaded, and what
install "method" you followed, i.e. did you add PHP and MySQL to your
PATH environment, or move the *.dll files around?

I have the same setup on an older NT 4 machine, and my client shows in
php_info() as 3.23.57. This doesn't affect any of the stuff I use the
setup for, but it's a mystery. There was a thread about this very
subject last week. I have a feeling that the .dll that comes with PHP
is "at fault" in my case, since mysql reports it's sever version as
4.1.7. I'm wondering if perhaps I shouldn't down-load and install
another PHP package that might be up-to-date.

I have the same setup on my OS X machine, and there, I get the same
results you do, but in that case, I compiled PHP (and Apache).

--
Tony Reed
<tr***@altern.org>
Jul 17 '05 #7
Your PHP installation seems funny to me. I downloaded the zip package from
http://www.php.net/downloads.php, not the one with the msi installer as this
only gives you the cgi version of PHP. I suggest you use this to install a
*complete* version of PHP. Do not forget to read the contents of file
install.txt as this contains valuable information.

--
Tony Marston

http://www.tonymarston.net

"varois83" <va******@netzero.net> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...

Hi again

This is the original poster again. I was just searching the web for
help on my problem (I must be on 5 hours on this now!) and something
keeps on poping up here and there but I don't know how to implement it
if that's my solution.
It seems the dynamic extension section of the "php.ini" file needs a
line like the following:

extension_dir="C:\PHP5\ext\"

My php.ini doesn't have one. Could that be it? I saw it mentionned
twice in answers to poster's problems on various forums.

My php extensions folder directory is:

C:\php-5.0.0-Win32\ext

I of course tried several of those "extension_dir" lines to no avail
after restarting Apache.

Thanks again

Patrick

Jul 17 '05 #8

"Tony Reed" <tr***@altern.org> wrote in message
news:Q5********************@news20.bellglobal.com. ..
On Mon, 6 Dec 2004 18:12:34 -0000
"Tony Marston" <to**@NOSPAM.demon.co.uk> wrote:

:I am using PHP 5.0.2 with MySQL 4.1.7 and Apache 2.0.52 on a Windows XP
PC
:without any problem. The MySQL client shows up as 4.1.3-beta.

I'd be interested in knowing what packages you down-loaded, and what
install "method" you followed, i.e. did you add PHP and MySQL to your
PATH environment, or move the *.dll files around?
(a) I used the full zip package.
(b) I added PHP and MySQL to my PATH environment variable.
I have the same setup on an older NT 4 machine, and my client shows in
php_info() as 3.23.57. This doesn't affect any of the stuff I use the
setup for, but it's a mystery. There was a thread about this very
subject last week. I have a feeling that the .dll that comes with PHP
is "at fault" in my case, since mysql reports it's sever version as
4.1.7. I'm wondering if perhaps I shouldn't down-load and install
another PHP package that might be up-to-date.
PHP 5 for windows comes with the new improved php_mysqli extension for
accessing MySQL client version 4.1.3 and above. Use this instead of the
original mysql extension.
I have the same setup on my OS X machine, and there, I get the same
results you do, but in that case, I compiled PHP (and Apache).

--
Tony Reed
<tr***@altern.org>

Jul 17 '05 #9
lig
varois83 wrote:
Tony Marston wrote:
You have to enable the mysql extension in your php.ini file. Seek
out the
entry which says ';extension=php_mysqli.dll' and remove the leading
semi-colon.
Tony

First-off thanks for taking the time to help, I really appreciate it.
The extension you mention isn't in my php.ini file and I checked both
since I have a "php.ini" in the C:Windows and another called
"php.ini-recommended" in the PHP 5 folder.
They appear identical. Here is pasted the extension section of the
php.ini file located in C:windows:

<Pasted starts>

;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
;
; If you wish to have an extension loaded automatically, use the
following
; syntax:
;
; extension=modulename.extension
;
; For example, on Windows:
;
; extension=msql.dll
;
; ... or under UNIX:
;
; extension=msql.so
;
; Note that it should be the name of the module only; no directory
information
; needs to go here. Specify the location of the extension with the
; extension_dir directive above.
;Windows Extensions
;Note that ODBC support is built in, so no dll is needed for it.
;

;extension=php_bz2.dll
;extension=php_cpdf.dll
;extension=php_curl.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_dbx.dll
;extension=php_exif.dll
;extension=php_fdf.dll
;extension=php_filepro.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_iconv.dll
;extension=php_ifx.dll
;extension=php_iisfunc.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
;extension=php_mbstring.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
;extension=php_mssql.dll
;extension=php_msql.dll
;extension=php_mysql.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_oracle.dll
;extension=php_pdf.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_sockets.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_w32api.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
;extension=php_yaz.dll
;extension=php_zip.dll

<Pasted ends>

I have tried several goofy things as sometimes it's like the lotto

you get lucky, but to no avail.

What I tried:

-I tried to change "extension=php_mysql.dll" to
"extension=php_mysqli.dll" with semi-colon removed, restarted apache
got error message saying unable to start dynamic library.
-Went into my PHP 5 folder and copied the "libmysqli.dll" file to
C:windows/system32, restarted apache got error message. Left the
"libmysqli.dll" in system 32 and added "extension=php_mysqli.dll" to
php.ini, restarted apache, error message again.

I hope the kind help keeps on coming, I think I am close.
Thanks again

Patrick

Please see http://www.php.net/manual/en/install...extensions.php.
Note in the PHP extension table php_mysql.dll and php_mysqli.dll that
they require an additional library to be installed - "PHP >= 5.0.0,
requires libmysql.dll (bundled)"

Jul 17 '05 #10

Hi

Well win some, lose some, this one is a loss. I just tried a few more
things including Lig's link, but to no avail.
I want to learn coding, not software troubleshooting.
I will delete php 5 and revert to PHP 4 tomorrow, hopefully that will
go smooth and easy.
Many thanks to Tony Marston and also Lig and zergc.

Regards

Patrick

Jul 17 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by Bruce A. Julseth | last post: by
8 posts views Thread by eholz1 | last post: by
18 posts views Thread by Bruce A. Julseth | last post: by
9 posts views Thread by christopher_board | last post: by
9 posts views Thread by nobody | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.