Home
Backend Development
PHP Tutorial
PHP connection database under IIS prompts mysql undefined function mysql_connect()_PHP tutorial



PHP connection database under IIS prompts mysql undefined function mysql_connect()_PHP tutorial
Jul 21, 2016 pm 03:37 PM
connect
function
iis
mysql
p
php
undefined
one
Down
Will
hint
database
connect
1.
Remove the ";" in front of the following parameters in PHP.ini:
Copy the code 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
Specific instructions
Place ;extension=php_mysql.dll
Change to
extension=php_mysql.dll
extension_dir = " "
Change to
extension_dir = "ext/"
Then change libmysql.dll Copy it to system32 and then restart it
Test whether php mysql can connect
<?php
$link=mysql_connect( 'localhost ', 'root ', '123456 ');
if(!$link) echo "fail ";
else echo "success ";
mysql_close();
?>
2.
1.php_info() Check if there is mysql (search for the "mysql" keyword), if there may be a version compatibility issue
2. If you have not copied the libmysql.dll in the php file to x:windowssystem32, change the mysql module in php.ini Comment out extension=php_mysql.dll and restart apache. If it still doesn't work, try restarting the machine and test using the php_info() function.
Right-click My Computer->Properties->Advanced->Environment Variables->System Environment Variables
a. Select Path in "System Environment Variables" to highlight this line, and then Select "Edit" and add ";D:php" (the directory where php.exe is located) at the end of the variable value
b. "System Environment Variables"->"New"->Variable name "PHPRC"- >Variable value "D:php" (the directory where php.ini is located) ->
2. Check that the PhpIniDir setting in the httpd.conf file points to the directory of Php.
3. Try to change PhpIniDir="C:/Php" in httpd.conf to PhpIniDir="C:Php".
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article
How Long Does It Take To Beat Split Fiction?
3 weeks ago
By DDD
Repo: How To Revive Teammates
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌

Hot tools Tags

Hot Article
How Long Does It Take To Beat Split Fiction?
3 weeks ago
By DDD
Repo: How To Revive Teammates
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian

How to fix mysql_native_password not loaded errors on MySQL 8.4
