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

http://www.bkjia.com/PHPjc/322010.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/322010.htmlTechArticle1. Remove the ";" in front of the following parameters in PHP.ini: Copy the code as follows: ; extension=php_dba.dll;extension=php_gd2.dll;extension=php_mbstring.dll;extension=php_m...
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 Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian

CakePHP Date and Time CakePHP Date and Time Sep 10, 2024 pm 05:27 PM

CakePHP Date and Time

CakePHP File upload CakePHP File upload Sep 10, 2024 pm 05:27 PM

CakePHP File upload

CakePHP Project Configuration CakePHP Project Configuration Sep 10, 2024 pm 05:25 PM

CakePHP Project Configuration

CakePHP Routing CakePHP Routing Sep 10, 2024 pm 05:25 PM

CakePHP Routing

Discuss CakePHP Discuss CakePHP Sep 10, 2024 pm 05:28 PM

Discuss CakePHP

How to fix mysql_native_password not loaded errors on MySQL 8.4 How to fix mysql_native_password not loaded errors on MySQL 8.4 Dec 09, 2024 am 11:42 AM

How to fix mysql_native_password not loaded errors on MySQL 8.4

CakePHP Quick Guide CakePHP Quick Guide Sep 10, 2024 pm 05:27 PM

CakePHP Quick Guide

See all articles