PHP connection MySQL prompt call to undefined function mysql_connect () _php Tutorial

Source: Internet
Author: User
Tags php mysql
Today the PHP MySQL environment is configured in Windows, it is nice to test a piece of code results to suggest that the call to undefined function mysql_connect () proves that the database configuration is unsuccessful.
The code is as follows Copy Code

$conn = mysql_connect (' localhost ', ' root ', ' password ');

Var_dump ($conn);

?>

The basic is to change the configuration file php.ini

First make sure that Extension_dir = "./ext" in PHP.ini, which is the directory of PHP reference DLLs;

1. Copy the Libmysql.dll and php5ts.dll two files under the PHP folder to system32 under the Windows directory, or add D:php;d:phpext to the environment variable. Both directories are directories of the PHP installation directory and the extension DLL.
2. Modify the php.ini in the Windows installation directory to remove; Extension=php_mysql.dll front semicolon;
3.extension_dir = "D:phpext (file in php.ini).

You look at the configuration of your php.ini to find

The code is as follows Copy Code

Extension=php_mysql.dll
Extension=php_mysqli.dll, remove the semicolon from the front.


I'm using Apache, so if I do, then look at the path and references in the main configuration file are set to No Phpinidir "PHP. INI path "Also add a sentence loadmodule************* content can be found on the Internet. In general, it can be solved basically here.

Find your PHP root directory and find two files Libmysql.dll and php5ts.dll copy them to System32 below. Remember that it's under PHP. Not MySQL.

http://www.bkjia.com/PHPjc/630734.html www.bkjia.com true http://www.bkjia.com/PHPjc/630734.html techarticle Today the PHP MySQL environment is configured in Windows, it is nice to test a piece of code results to suggest that the call to undefined function mysql_connect () proves that the database configuration is unsuccessful. The code is as follows ...

  • Related Article

    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.