Today the PHP MySQL environment is configured in Windows, it is nice to test a piece of code results to suggest that the call to undefined function mysql_connect () proves that the database configuration is unsuccessful.
The code is as follows |
Copy Code |
$conn = mysql_connect (' localhost ', ' root ', ' password '); Var_dump ($conn); ?> |
The basic is to change the configuration file php.ini
First make sure that Extension_dir = "./ext" in PHP.ini, which is the directory of PHP reference DLLs;
1. Copy the Libmysql.dll and php5ts.dll two files under the PHP folder to system32 under the Windows directory, or add D:php;d:phpext to the environment variable. Both directories are directories of the PHP installation directory and the extension DLL.
2. Modify the php.ini in the Windows installation directory to remove; Extension=php_mysql.dll front semicolon;
3.extension_dir = "D:phpext (file in php.ini).
You look at the configuration of your php.ini to find
The code is as follows |
Copy Code |
Extension=php_mysql.dll Extension=php_mysqli.dll, remove the semicolon from the front. |
I'm using Apache, so if I do, then look at the path and references in the main configuration file are set to No Phpinidir "PHP. INI path "Also add a sentence loadmodule************* content can be found on the Internet. In general, it can be solved basically here.
Find your PHP root directory and find two files Libmysql.dll and php5ts.dll copy them to System32 below. Remember that it's under PHP. Not MySQL.
http://www.bkjia.com/PHPjc/630734.html www.bkjia.com true http://www.bkjia.com/PHPjc/630734.html techarticle Today the PHP MySQL environment is configured in Windows, it is nice to test a piece of code results to suggest that the call to undefined function mysql_connect () proves that the database configuration is unsuccessful. The code is as follows ...