473,324 Members | 2,268 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

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 11130
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Bruce A. Julseth | last post by:
When I execute this SQL statement in my PHP code, I get an error "File '.\Address.txt' not found (Errcode: 2)" $File = addslashes(".\Address.txt"); $SQL = "Load Data InFile \"" . $File . "\"...
6
by: das dsf | last post by:
Hi there! I have both PHP 4.0( RPM) installed and MySQL 4.0.20 installed with the mysqld daemon up and running. But when I look at the output of phpinfo() , I do not see it there, which is...
4
by: MLH | last post by:
A programmer developed an AMP (Apache/MySQL/PHP) application for me. When he was done, he sent me the PHP files and the MySQL dump file. Now, when I connect to the application on my LAN using...
5
by: NewbieSupreme | last post by:
I installed Apache 2.0.58, tested it, got the "working" page. Installed MySQL 5.0.22, and didn't really see how to test that, but there is a mysql process running in the task manager. Ran through...
8
by: eholz1 | last post by:
Hello Newsgroup, I have redhat 3.0 Enterprise, and mysql (3.58.xxx more or less) installed from a redhat rpm, and php 4.3.9 (installed from an rpm) - I can access data from my mysql db using php...
18
by: Bruce A. Julseth | last post by:
I have the following code $Host = "localhost"; $User = "Fred"; $Database = "house"; $Password = "mypw" echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br />" . $Database;
9
by: christopher_board | last post by:
Hi all. I am trying to connect to a MySQL Database using PHP on a local machine using locahost. I am using the following code <?php $dbhost = 'localhost'; $dbuser = 'root'; $dbpass =...
9
by: nobody | last post by:
I install rpms for php and mysql and php-mysql on rhel5. however phpinfo is showing --without-mysql' any idea on how i can enable mysql support?
4
by: Frank Lopes | last post by:
I've seen many people asking the same question in other forums but I haven't been able to solve this problem. First the environment: Windows Vista Ultimate running IIS6 Now the story:...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.