473,766 Members | 2,023 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\h tdocs\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\SYST EM32.

I hope someone can help me

Thanks a lot

Patrick
Jul 17 '05 #1
10 11156
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******@netze ro.net> wrote in message
news:a3******** *************** ***@posting.goo gle.com...
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\h tdocs\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\SYST EM32.

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.goo glegroups.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=modul ename.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.de mon.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.o rg>
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******@netze ro.net> wrote in message
news:11******** *************@f 14g2000cwb.goog legroups.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.o rg> wrote in message
news:Q5******** ************@ne ws20.bellglobal .com...
On Mon, 6 Dec 2004 18:12:34 -0000
"Tony Marston" <to**@NOSPAM.de mon.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.o rg>

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=modul ename.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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
9760
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 . "\" into table addresses"; $result = mysql_query($SQL) or die(mysql_error()); The file is located in the same directory as my .PHP file. How do I generate a relative address for this file so that it can be found?
6
3865
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 worrisome and so I tried to recompile PHP and do ./configure with the --with-mysql=path but I don't really know where my mysql's header files should be , is there any way to find that out by using any of the mysql commands? I did try to do...
4
2812
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 http://192.168.1.106/~mlh/credifree/index.php the AMP app still thinks the data resides somewhere else. It runs fine - as long as I leave my LAN's external internet connection up. But if I unplug my LAN from the world, my app locks up. Before I...
5
3370
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 the PHP 5.1.4 installation directions, and that seems to work, since I can use phpinfo() and get all the information on a test php page. Then I installed (really just unzipped and placed some files according to the directions) PHPMyAdmin; did...
8
2164
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 and the "pear" Db .php. I recently upgraded my Apache to 2.2 and installed (more or less) PHP 5.2 as well - neither of these installs were from a Redhat rpm, I downloaded the tarballs, extracted, configed, make, etc. Apache seems to work fine...
18
2248
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
3187
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 = 'password'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
9
2624
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
1801
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: Installed PHP and configured it in IIS with no problems. Installed MySQL with no problems. Both up and running except that PHP will not recognize the presence of MySQL
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9404
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10008
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8833
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7381
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.