Defined IIS under PHP connection database hint MySQL undefined function mysql_connect

Source: Internet
Author: User
One
The ";" in front of the following parameters in the php.ini Remove:

Copy the Code code as follows:


; Extension=php_dba.dll
; Extension=php_gd2.dll
; Extension=php_mbstring.dll
; Extension=php_mcrypt.dll
; Extension=php_mysql.dll
; Extension=php_mysqli.dll
; Extension=php_pdo.dll
; Extension=php_pdo_mysql.dll


Save the file, restart IIS
Specific instructions
PHP.ini inside the
; Extension=php_mysql.dll
Change into
Extension=php_mysql.dll
Extension_dir = ""
Change into
Extension_dir = "ext/"
And then copy the Libmysql.dll to System32 and then reboot.
Test if PHP MySQL can connect
$link =mysql_connect (' localhost ', ' root ', ' 123456 ');
if (! $link) echo "fail";
else echo "Success";
Mysql_close ();
?>
Two
1.php_info () Check if there is a MySQL (search "mysql" keyword), if it is possible version compatibility issues
2. If you do not copy the PHP file in the Libmysql.dll to x:windowssystem32 the php.ini in the MySQL module to remove the comments Extension=php_mysql.dll restart Apache if not yet Reboot the machine try the test using Php_info ().
Right-click My Computer, properties, high-level environment variable, system environment variables
A. In system environment variables, select Path to highlight the line, and then select Edit to Add ";D: \php" At the end of the variable value (Php.exe directory)
B. Variable name "PHPRC", "New", "System environment variable", "D:\php" (php.ini directory)
2. Look at the settings of the Phpinidir in the httpd.conf file to point to the PHP directory.
3. Try to change the phpinidir= "c:/php" in httpd.conf to Phpinidir= "C:\PHP".

The above describes the defined IIS under the PHP connection database hint MySQL undefined function mysql_connect, including the defined aspects of the content, I hope to be interested in PHP tutorial friends helpful.

  • 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.