Php cannot connect to mysql

Source: Internet
Author: User
The Fatal error: Call to undefined function mysql_connnect () error occurs when the php statement cannot connect to mysql.
No problem with the code. I also searched the instructions on the network for the settings and did not solve the problem.
1. modify this sentence in the configuration file (PHP. ini file) of the php installation directory:
Extension_dir = "php installation directory/ext" (for example, extension_dir = "F:/amp/php/ext") pay attention to the slash direction
2. comment out the following two rows (a semicolon represents a comment)
Extension = php_mysql.dll;
Extension = php_mysqli.dll;
3. add this sentence to the Apache configuration file: LoadFile "php installation directory/libmysql. dll" to restart Apache

This basically does not solve the problem!

Find a better solution!


Reply to discussion (solution)

Libmysql. dll and php5ts. dll files are also stored under windows -- styme32 on drive C.

These two files are also stored in system32, which still does not solve the problem and has been reinstalled several times. mysql command line is OK, phpmyadmin is OK, and jdbc connection is no problem, that is, there is a problem when writing php statements.

Is there php_mysql.dll and php_mysqli.dll in the ext directory under your php directory?

Print phpinfo and check whether mysql is correctly loaded

There are no mysql items please follow the steps carefully for reference to http://www.111cn.net/database/mysql/46081.htm

Do not install an integrated version environment, wam

FineCMS uses PHP5 + MYSQL as the technical basis and uses the CI3.0 framework as the core. all custom fields are available. the FineCMS address is www.dayrui.com/cms/

Print phpinfo and check whether mysql is correctly loaded

There are no mysql items please follow the steps carefully for reference to http://www.111cn.net/database/mysql/46081.htm



This is also true. Loaded successfully, enable


Is there php_mysql.dll and php_mysqli.dll in the ext directory under your php Directory? [/quote

This file also has

As a matter of fact, it should be okay if all of them are configured. Is there any mysql extension in PHPinfo. How can I reinstall mysql ??

Fatal error: Call to undefined function mysql_connnect ()
The mysql_connnect function is not defined.
Php_mysql provides the mysql_connect function, but does not provide the mysql_connnect function.

Σ (° △° | )? Or the moderator's heart: your code is wrong ....

Thanks! Another installation

Fatal error: Call to undefined function mysql_connnect ()
The mysql_connnect function is not defined.
Php_mysql provides the mysql_connect function, but does not provide the mysql_connnect function.


Yes, it is still a problem to change it. just change it, wam. Thank you.

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.