MySQL undefined function mysql_connect () is prompted when PHP is connected to the database under IIS ()

Source: Internet
Author: User

I,
Remove the ";" before the following parameters in PHP. ini: CopyCode The Code is 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 and restart IIS
description
PHP. in INI, set
; extension = php_mysql.dll
changed to
extension = php_mysql.dll
extension_dir = ""
changed to
extension_dir = "ext/"
libmysql. copy the DLL to system32 and then restart it.
test whether PHP MySQL can be connected.
$ link = mysql_connect ('localhost', 'root', '123');
If (! $ Link) echo "fail";
else echo "success";
mysql_close ();
?>
2.
1. php_info () check whether there is a MySQL item (search for the "MySQL" keyword). If there is a possible version compatibility problem
2. if you do not set libmysql in the PHP file. DLL copy to X: windowssystem32 to copy PHP. remove extension = php_mysql.dll from the comment of the MySQL module in ini to restart Apache. If not, restart the machine and try to test the function using php_info.
right-click my computer and choose Properties> advanced> environment variables> system environment variables
. select path in "system environment variables" to make this line highlighted, then select "edit", and add "; D: \ php#(php.exe directory) at the end of the variable value)
B. "system environment variables"-> "new"-> variable name "phprc"-> variable value "D: \ PHP" (PHP. INI directory)->
2. check httpd. set phpinidir In the conf file to point to the PHP Directory.
3. Try changing phpinidir = "C:/PHP" in httpd. conf to phpinidir = "C: \ PHP ".

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.