[PHP.ini] Error in PHP calling mysql_connect () function: Call to undefined function mysql_connect ()

Source: Internet
Author: User

Beginners first Use Appserv or XAMPP integrated installation package, so that you do not have to install the apahce/mysql/php alone and worry about.

I've been setting up my own environment lately, and I'm always having a MySQL extension that doesn't fit. The extension of Extension=php_mysql.dll has been opened in php.ini. Later discovered that the core point is under the Windows system, the required PHP directory: Libmysql.dll and Php5ts.dll Copy to: Under the Windows directory under the system32!

Fatal error:call to undefined function mysql_connect ()

Did not open MySQL extension.

PHP.ini inside; extension=php_mysql.dll Remove the preceding semicolon.

------------------------------------------------------------------------------------------------------------

This error was encountered today when debugging a database connection:

Fatal error:call to undefined function mysql_connect () in ...

Refer to the comments on the Internet, but not very detailed, many are not easy to understand, so slowly debugging, after finally OK!

1. Copy the Libmysql.dll and Php5ts.dll to System32 under the Windows directory!

2. Modify the php.ini in the Windows installation directory to remove; Extension=php_mysql.dll front semicolon;

There are always the following issues
Fatal error:call to undefined function mysql_connect () inch D:\masterphp\test-mysql.php on line 2
And also
Fatal error:call to undefined function imagecreatefrompng () inch D:\masterphp\make_button.php on line 11

I've used almost all the methods on the Internet, such as:
Copy the external library libmysql.dll to the System32 directory, and then remove the semicolon from the Extension=php_mysql.dll, I actually copied all the. dll to the System32 directory, and removed all the extension =* the former;

But it's still not working.

Configured as follows
Apahce 2.0.59, PHP 5.1.6 MYSQL 5.0

Finally add
Phpinidir "D:\PHP5"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.