Today I configured the php mysql environment in windows. I am very happy to test a piece of code and the result prompts Call to undefined function mysql_connect(), which proves that the database configuration was unsuccessful.
The code is as follows
代码如下 |
复制代码 |
$conn = mysql_connect('localhost','root','password');
var_dump($conn);
?>
|
|
Copy code
|
$conn = mysql_connect('localhost','root','password');
var_dump($conn);
?>
代码如下 |
复制代码 |
extension=php_mysql.dll
extension=php_mysqli.dll把前面的分号去掉
|
Basically change the configuration file php.ini
First make sure extension_dir = "./ext" in php.ini, this setting is the directory where php refers to the dll; |
1. Copy the two files libmysql.dll and php5ts.dll in the php folder to system32 in the windows directory; or add D:php;D:phpext to the environment variables. 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 in front of extension=php_mysql.dll;
3.extension_dir = "d:phpext (the file is in PHP.INI).
Look at the configuration of your php.ini and find it
The code is as follows
|
Copy code
|
extension=php_mysql.dll
extension=php_mysqli.dll remove the semicolon in front
I'm using apache, so if you still have this line, check to see if the paths and references in the main configuration file have been set. PHPIniDir "PHP.INI path" and add LoadModule************ The content of ***** can be found online. Under normal circumstances, this can basically be solved.
Find your PHP root directory, find two files libmysql.dll and php5ts.dll and copy them to system32. Remember it is under PHP. Not MYSQL
http://www.bkjia.com/PHPjc/630734.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/630734.htmlTechArticleI configured the php mysql environment in windows today. I am very happy to test a piece of code and the result prompts Call to undefined function mysql_connect() This proves that the database configuration was unsuccessful. The code is as follows...
|
Statement: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