Urgent php connection to mysql

Source: Internet
Author: User
In a hurry !! Php connection mysql problem win7 flagship version + php5.3.6 + mysql5.5.10 + Apache2.2.7 configuration, mysql and php are good, but do not know what is going on, php cannot connect to mysql, as for php. I also removed extension = php_gd2.dllextension from the semicolons in ini !! Php connection to mysql
For the win7 flagship version + php5.3.6 + mysql5.5.10 + Apache2.2.7 configuration, mysql and php are both good, but I don't know what's going on. php cannot connect to mysql, as for php. I also removed the semicolons in ini.
Extension = php_gd2.dll
Extension = php_mbstring.dll
Extension = php_mysql.dll
Extension = php_mysqli.dll
After a file is written to connect to mysql, the following error occurs when running in the php environment:
Fatal error: Call to undefined function mysql_connect () in F: \ Localhost \ mysql_connect.php on line 6
The database file has been confirmed to be correct. hope you guys can help me find a solution. please be in a hurry !!!!

------ Solution --------------------
Is it my problem: http://blog.csdn.net/tgh1981/archive/2011/04/27/6366067.aspx
Mysql database connection problems, difficult to solve...

------ Solution --------------------
Post the error. log file in the log folder under your APACHE installation directory
------ Solution --------------------
Try using mysqli_connect (). you can see if the configuration file of your php. ini in the system has been modified. or check whether mysql is supported in phpinfo (); disable?
------ Solution --------------------
Dude, I think it's a problem with your php version. it's not only about IPVs and unix, but also about multithreading. although I'm a newbie, I 've configured the environment for two weeks before I can give my software name. you see
Apache: httpd-2.2.17-win32-x86-openssl-0.9.8o.msi
Mysql: mysql-5.5.10-win32.msi
Php: php-5.2.17-Win32-VC6-x86.zip
Among them, php is divided into VC6 and VC9. you can see what your situation is. go to the official website and take a look at the Chinese on the left. upload my installation file to you
I think vista is similar to yours.
------ Solution --------------------
After removing the dll file, you also need to set it in win7 to allow the operating system to find the dll file.
The method is as follows:
Right-click "computer"-> Properties-> Advanced System Settings-> Select "Advanced tab"-> "environment variables" in the lower right corner-> select Path in the following system variable box, click edit->
Add "; C: \ PHP \ ext" to the variable value (excluding parentheses)
(My php is installed in the c root directory, so if you load program files, you should write "; C: \ Program Files \ PHP; C: \ Program Files \ PHP \ ext ")
Note: Do not delete the original variable value, but add it after the variable value.
Then restart the instance to make it take effect only after it is restarted.
------ Solution --------------------
In fact, this problem is generally not a problem. You cannot find the mysql module when running phpinfo.
Search for the php. ini file in C: \ Windows and check the file before extension = php_mysql.dll. Do not create extension = php_mssql.dll. These two images are compared. copy a file to the system32 directory,
Libmysql. dll, which is found in php. ini:
Extension_dir = "./"
Change it to the absolute path of the ext subdirectory in your php installation directory. For example, my:
Extension_dir = "C:/php/ext /"
This step is important. Otherwise, php cannot find the php_mysql.dll module and cannot load it.
Restart your computer or apache. if you run the phpinfo command containing mysql, the load is successful. Otherwise, the load is successful... You know!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.