When php is connected to mysql, Calltoundefinedfunctionmysql_connect () is displayed (). I configured the phpmysql environment in windows today. I'm glad to test a piece of code that prompts Calltoundefinedfunctionmysql_connect (). This proves that the database configuration is not successful. The code is as follows. Today, the php mysql environment is configured in windows. we are glad to test a piece of code that prompts Call to undefined function mysql_connect (). This proves that the database configuration is not successful.
| The code is as follows: |
|
|
$ Conn = mysql_connect ('localhost', 'root', 'password ');
Var_dump ($ conn );
?> |
The configuration file php. ini is changed.
First, make sure that extension_dir = "./ext" in php. ini is the directory where php references dll;
1. copy the libmysql. dll and php5ts. dll files in the php folder to system32 in the windows directory, or add D: php; D: phpext to the environment variable. These two directories are the php installation directory and the extension dll directory.
2. modify php. ini in the windows installation directory and remove the semicolon before extension = php_mysql.dll;
3. extension_dir = "d: phpext (file in PHP. INI ).
Look at your php. ini configuration.
| The code is as follows: |
|
|
Extension = php_mysql.dll
Extension = php_mysqli.dll remove the semicolon |
I use apache, so if this line is still in use, check whether the path and reference in the main configuration file are set, without PHPIniDir "PHP. the INI path "can be found online with the LoadModule. Generally, this can be basically solved here.
Find your PHP root directory and find the libmysql. dll and php5ts. dll files to copy them to system32. Remember that it is under PHP. Not MYSQL
In the prepare mysql environment, we are glad to test a piece of code and the prompt "Call to undefined function mysql_connect ()" indicates that the database configuration is not successful. The code is as follows...