logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: apache2.2.3+php5.2.0+mysql5.1.12+WinxpSp2 Error!
Author
yickoCN



Joined: 09 Nov 2006
Posts: 8
Location: China

PostPosted: Thu 09 Nov '06 15:04    Post subject: apache2.2.3+php5.2.0+mysql5.1.12+WinxpSp2 Error! Reply with quote

Fatal error: Call to undefined function mysql_connect() in D:\PHP\WebSite\index.php on line 4
my index.php :
<html>
<body>
<h1>
<?php
$link=mysql_connect('localhost','root','123456');
if(!$link) echo "fail";
else echo "success";
mysql_close();
?>
</h1>
<? echo phpinfo(); ?>
</body>
</html>
if modify my index.php

<html>
<body>
<? echo phpinfo(); ?>
</body>
</html>


will correct run
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Thu 09 Nov '06 15:06    Post subject: Reply with quote

Sure that you enabled php_mysql.dll in php.ini ?
Back to top
yickoCN



Joined: 09 Nov 2006
Posts: 8
Location: China

PostPosted: Thu 09 Nov '06 15:22    Post subject: Yes! Reply with quote

James Blond wrote:
Sure that you enabled php_mysql.dll in php.ini ?



Yes ! I sure

extension=php_mssql.dll
extension=php_msql.dll
extension=php_mysql.dll
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Thu 09 Nov '06 16:02    Post subject: Reply with quote

Maybe you can give first a try the mysqlinfo.zip at the download page here. It is PHP script for testing your MySQL PHP-extension installation.

Steffen
Back to top
yickoCN



Joined: 09 Nov 2006
Posts: 8
Location: China

PostPosted: Thu 09 Nov '06 16:18    Post subject: Reply with quote

Steffen wrote:
Maybe you can give first a try the mysqlinfo.zip at the download page here. It is PHP script for testing your MySQL PHP-extension installation.

Steffen



The result is :

php MySQL extension not loaded !!

Check in php.ini if extension=php_mysql.dll is enabled, and that the extension_dir = is pointing to your php/ext folder.

Copy libmySQL.dll from your Mysql/bin folder to c:/windows.[/img]
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Thu 09 Nov '06 16:26    Post subject: Reply with quote

Check also at the top of phpinfo() where PHP is finding your php.ini (Configuration File (php.ini) Path)
Back to top
yickoCN



Joined: 09 Nov 2006
Posts: 8
Location: China

PostPosted: Fri 10 Nov '06 1:39    Post subject: Reply with quote

Steffen wrote:
Check also at the top of phpinfo() where PHP is finding your php.ini (Configuration File (php.ini) Path)



I don't understand!?

What?
Back to top
pnllan



Joined: 05 Dec 2005
Posts: 221

PostPosted: Fri 10 Nov '06 7:26    Post subject: Reply with quote

Steffen is talking about the information displayed from phpinfo. You should observe in the top table of information that there is a row with Configuration File (php.ini) Path. He is asking if the path agrees with where you actually installed PHP.

I believe your problem is that Apache/PHP cannot find the file libmysql.dll. You can copy this file from the MySQL BIN folder to one of the following locations depending on how you setup Apache and PHP:

a) PHP folder (overwrite existing file)
b) Apache BIN folder
c) C:\WINDOWS
or
d) C:\WINDOWS\system32

That should fix you up.
Back to top
yickoCN



Joined: 09 Nov 2006
Posts: 8
Location: China

PostPosted: Fri 10 Nov '06 8:17    Post subject: Reply with quote

I had copy "libmysql.dll" to

a) PHP folder (overwrite existing file)
b) Apache BIN folder
c) C:\WINDOWS
or
d) C:\WINDOWS\system32

but... Error !~

www.apachelounge.com



php MySQL extension not loaded !!

Check in php.ini if extension=php_mysql.dll is enabled, and that the extension_dir = is pointing to your php/ext folder.

Copy libmySQL.dll from your Mysql/bin folder to c:/windows.



PHP Version 5.2.0

System Windows NT CUNPENG 5.1 build 2600
Build Date Nov 2 2006 11:50:55
Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--with-gd=shared"
Server API Apache 2.0 Handler
Virtual Directory Support enabled
Configuration File (php.ini) Path C:\WINDOWS
PHP API 20041225
PHP Extension 20060613
Zend Extension 220060519
Debug Build no
Thread Safety enabled
Zend Memory Manager enabled
IPv6 Support enabled
Registered PHP Streams php, file, data, http, ftp, compress.zlib
Registered Stream Socket Transports tcp, udp
Registered Stream Filters convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, zlib.*

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies
Back to top
pnllan



Joined: 05 Dec 2005
Posts: 221

PostPosted: Fri 10 Nov '06 10:31    Post subject: Reply with quote

MySQL 5.1 is still in BETA, so I will setup a test-bed using it instead of MySQL 5.0 to see if that might be the issue. My past experience has been that MySQL ALPHA and BETA releases can be problematic when it comes to integrating PHP.

For your reference, I setup WAMP as I have written in the following link:

http://www.apachelounge.com/viewtopic.php?t=570

That setup strictly adheres to PHP standards and advice written in the PHP manual.
Back to top
yickoCN



Joined: 09 Nov 2006
Posts: 8
Location: China

PostPosted: Fri 10 Nov '06 10:51    Post subject: Reply with quote

Sorry , my MySql ver is 5.0


I modify my httpd.conf ,

insert PHPIniDir = "D:/PHP/php/php.ini"

new Error

Back to top
yickoCN



Joined: 09 Nov 2006
Posts: 8
Location: China

PostPosted: Fri 10 Nov '06 11:04    Post subject: Reply with quote

Success!!

Thanks for your help!

I come from China , My english is very poor!

I want to study english, do you help me?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Fri 10 Nov '06 12:14    Post subject: Reply with quote

Come to your new IRC channel
server apachelounge
chanel #Lounge

Wink
Back to top
yickoCN



Joined: 09 Nov 2006
Posts: 8
Location: China

PostPosted: Fri 10 Nov '06 13:16    Post subject: Reply with quote

What is "IRC channel" ?

How can I join the channel?
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Fri 10 Nov '06 13:45    Post subject: Reply with quote

What is IRC, see:

http://en.wikipedia.org/wiki/Internet_Relay_Chat
http://www.irchelp.org/
Back to top


Reply to topic   Topic: apache2.2.3+php5.2.0+mysql5.1.12+WinxpSp2 Error! View previous topic :: View next topic
Post new topic   Forum Index -> Other Software