473,397 Members | 1,961 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,397 software developers and data experts.

PHP not supporting MySQL

My PHP version is obviously not compiled with MySQL support,
consequently I get the following message:-

Fatal error: Call to undefined function mysql_connect() in
C:\http-dir\board\connect.php on line 3

Question:- How do I instruct PHP to support MySQL?

Please note:-

extension=php_mysql.dll
extension=php_pdo_mysql.dll

in php.ini are enabled, and php.ini is located in the php root directory.

Thank you.
Feb 7 '07 #1
7 9383
be sure libmysql.dll is available to the systems PATH.

from php.net:

Go to Control Panel and open the System icon (Start -Settings ->
Control Panel -System, or just Start -Control Panel -System for
Windows XP/2003)

Go to the Advanced tab

Click on the 'Environment Variables' button

Look into the 'System Variables' pane

Find the Path entry (you may need to scroll to find it)

Double click on the Path entry

Enter your PHP directory at the end, including ';' before (e.g. ;C:\php)

Press OK and restart your computer


hope this helps

Siegfreed schreef:
My PHP version is obviously not compiled with MySQL support,
consequently I get the following message:-

Fatal error: Call to undefined function mysql_connect() in
C:\http-dir\board\connect.php on line 3

Question:- How do I instruct PHP to support MySQL?

Please note:-

extension=php_mysql.dll
extension=php_pdo_mysql.dll

in php.ini are enabled, and php.ini is located in the php root directory.

Thank you.
Feb 7 '07 #2
Siegfreed wrote:
My PHP version is obviously not compiled with MySQL support,
consequently I get the following message:-

Fatal error: Call to undefined function mysql_connect() in
C:\http-dir\board\connect.php on line 3

Question:- How do I instruct PHP to support MySQL?

Please note:-

extension=php_mysql.dll
extension=php_pdo_mysql.dll

in php.ini are enabled, and php.ini is located in the php root directory.

Thank you.
First of all, there's no need to change the registry if you have your
php.ini file in the right place.

Secondly, there are three extensions you could be interested in.

extension=php_mysql.dll // (older) mysql_xxx interface
extension=php_mysqli.dll // (newer) mysqli_xxx objects
extension=php_pdo_mysql.dll // (newest) PDO interface for MySQL
extension=php_pdo.dll // also required for PDO

(note: the last, PHP Data Objects, is an abstraction layer for data
access. It's relatively new, so you probably won't see much existing
code using it.

Most sites use the mysql_xxx interface, while there are some going to
the mysqli_interface.

And the interfaces are quite compatible - you can load all three and
pick whichever one you want to use in your code.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Feb 7 '07 #3

"Siegfreed" <si**@freed.orgwrote in message
news:45***********************@news.optusnet.com.a u...
My PHP version is obviously not compiled with MySQL support, consequently
I get the following message:-

Fatal error: Call to undefined function mysql_connect() in
C:\http-dir\board\connect.php on line 3

Question:- How do I instruct PHP to support MySQL?

Please note:-

extension=php_mysql.dll
extension=php_pdo_mysql.dll

in php.ini are enabled, and php.ini is located in the php root directory.

Thank you.
Along with the previous advice to add PHP dir to your system path, from the
top of my head

1) Run phpinfo() and see if the report displays the correct path to your
php.ini
2) Uncomment extension_dir in php.ini and set it to the appropriate folder

Something along the lines of
extension_dir = "C:\PHP\ext\"
p.s I do hope you installed PHP from the binary zip, not the installer, as
the second one doesn't include mysql support to my knowledge
Denis Gerina
Feb 7 '07 #4
I copied "libmysql.dll", and "php.ini" to the system PATH, and the
"fatal error" message disappeared. I will modify the system PATH (as
you suggested) if for some reason I need the "php.ini" in the in the
"php" directory.

Thank you.

Vincent wrote:
be sure libmysql.dll is available to the systems PATH.

from php.net:

Go to Control Panel and open the System icon (Start -Settings ->
Control Panel -System, or just Start -Control Panel -System for
Windows XP/2003)

Go to the Advanced tab

Click on the 'Environment Variables' button

Look into the 'System Variables' pane

Find the Path entry (you may need to scroll to find it)

Double click on the Path entry

Enter your PHP directory at the end, including ';' before (e.g. ;C:\php)

Press OK and restart your computer

hope this helps

Siegfreed schreef:
>My PHP version is obviously not compiled with MySQL support,
consequently I get the following message:-

Fatal error: Call to undefined function mysql_connect() in
C:\http-dir\board\connect.php on line 3

Question:- How do I instruct PHP to support MySQL?

Please note:-

extension=php_mysql.dll
extension=php_pdo_mysql.dll

in php.ini are enabled, and php.ini is located in the php root directory.

Thank you.
Feb 9 '07 #5
Jerry Stuckle wrote:
Siegfreed wrote:
>My PHP version is obviously not compiled with MySQL support,
consequently I get the following message:-

Fatal error: Call to undefined function mysql_connect() in
C:\http-dir\board\connect.php on line 3

Question:- How do I instruct PHP to support MySQL?

Please note:-

extension=php_mysql.dll
extension=php_pdo_mysql.dll

in php.ini are enabled, and php.ini is located in the php root directory.

Thank you.


First of all, there's no need to change the registry if you have your
php.ini file in the right place.

Secondly, there are three extensions you could be interested in.

extension=php_mysql.dll // (older) mysql_xxx interface
extension=php_mysqli.dll // (newer) mysqli_xxx objects
extension=php_pdo_mysql.dll // (newest) PDO interface for MySQL
extension=php_pdo.dll // also required for PDO

(note: the last, PHP Data Objects, is an abstraction layer for data
access. It's relatively new, so you probably won't see much existing
code using it.

Most sites use the mysql_xxx interface, while there are some going to
the mysqli_interface.

And the interfaces are quite compatible - you can load all three and
pick whichever one you want to use in your code.
I think you are right in saying: "there's no need to change the registry
if you have your php.ini file in the right place". By moving the
"php.ini" to "c:\windows", the "fatal error" message was eliminated.

In addition, I copied "libmysql.dll" to "c:\windows", it appears to work
fine so far.

Thank you.
Feb 9 '07 #6
I think you are right in saying: "there's no need to change the registry
if you have your php.ini file in the right place". By moving the
"php.ini" to "c:\windows", the "fatal error" message was eliminated.

In addition, I copied "libmysql.dll" to "c:\windows", it appears to work
fine so far.
I knew some would get around to saying they copied files into C:
\WINDOWS.

There is no reason to place ANYTHING in C:\windows.

No reason to modify the registry (I don't consider ENV VARS registry,
yes I know, that's where it lives, but...)

go to

http://web.torres.ws/walters_way

I have complete docs that explain how to set up Apache and PHP without
doing on of this "windows-centric" stuff.

In fact, I had to replace my OS drive last week. Took my 2 hours to
reinstall XP Pro and the drivers and the like.

It took my 10 minutes to "reinstall" Apache, mySQL, Perl, PHP and
SSH2, along with 90% of linux command line tools.

See if that method helps you.

Walter

Feb 9 '07 #7
ot*******@gmail.com wrote:
>I think you are right in saying: "there's no need to change the registry
if you have your php.ini file in the right place". By moving the
"php.ini" to "c:\windows", the "fatal error" message was eliminated.

In addition, I copied "libmysql.dll" to "c:\windows", it appears to work
fine so far.

I knew some would get around to saying they copied files into C:
\WINDOWS.

There is no reason to place ANYTHING in C:\windows.
That's one opinion. I happen to keep certain configuration files there.
No reason to modify the registry (I don't consider ENV VARS registry,
yes I know, that's where it lives, but...)
Changing the environment *is* changing the registry. And environment
changes are applied to every program loaded, not just the one process
reading the configuration file. My environment is already 3K long -
without adding unnecessary things to it.
go to

http://web.torres.ws/walters_way

I have complete docs that explain how to set up Apache and PHP without
doing on of this "windows-centric" stuff.
There is nothing wrong with making use of the tools at hand.
In fact, I had to replace my OS drive last week. Took my 2 hours to
reinstall XP Pro and the drivers and the like.
Good for you. I lost my hard drive. It took me 4 days to reinstall
Windows 2K, apply all of the patches and restore from backup. Next step
is a better backup program.
It took my 10 minutes to "reinstall" Apache, mySQL, Perl, PHP and
SSH2, along with 90% of linux command line tools.
Didn't even take me that long. Once the OS was restored, it was a
simple matter to restore the rest of the system (about 40GB).
See if that method helps you.

Walter


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Feb 9 '07 #8

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

Similar topics

6
by: Richie | last post by:
I went through the past six months or so of entries in c.l.javascript, and found a couple where people had expressed opinions about the value of supporting much older versions of Netscape and IE. ...
48
by: Nirvana | last post by:
How to make the font size constant in HTML code, so that in a web browser it remains fixed. For e.g in IE if you press CTRL and move mouse wheel front or back the font size changes, cheers
3
by: TClancey | last post by:
Hi all. I have an app that needs to connect to either - an Access database, MySql database or MsSql database. It will be the end users decision which they want to use. I've done a lot of...
35
by: salad | last post by:
I have an application written in MS-Access. It is a complete application that manages the day-to-day operations of a business. The program is nearly ready to be used in other customer sites. ...
399
by: =?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?= | last post by:
PEP 1 specifies that PEP authors need to collect feedback from the community. As the author of PEP 3131, I'd like to encourage comments to the PEP included below, either here (comp.lang.python), or...
0
by: egur | last post by:
Hi, I'm looking for reliable MySQL version (for Windows) that supports "EXCEPT" and "INTERSECT" execution. Would somebody recommend such version (and corresponding client), please?
3
by: =?Utf-8?B?U29hcHk=?= | last post by:
Hi: I heard from a friend that Microsoft will no longer support XP. There is a sign-up page for those people who still use it and would like MS to continue supporting it. I don't know if this...
4
by: Gilles Ganault | last post by:
Hello What does it take to support locales? The following test code found on the PHP site doesn't work as planned: ======= setlocale(LC_TIME, "C"); echo strftime("%A"); setlocale(LC_TIME,...
2
by: Abhijat Vatsyayan | last post by:
Hi, I am looking for a MySQL driver (or configuration) for PHP which will support fail-over to a slave database in case of a master failure (we have a MySQL master-slave replication setup). I have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.