Solutions not supported by php mysql_connect ()

Source: Internet
Author: User

The mysql_connect () function is a connection function between php and mysql databases. If your php does not support the mysql_connect () function, your database cannot be connected to mysql, next I will summarize the solutions that cannot be used by mysql_connect.

For the apache environment, refer to the following solution.


1. libmysql is missing in the system32 (C:/windows/system32) Directory of the system. dll file. The solution is to find libmysql in the php Directory. dll, and libmysql. copy the dll to the C:/windows/system32 directory and restart the Web service.

2. php In the C:/windows Directory. in the INI file, the previous ";" in "; extension = php_mysql.dll" is not removed, so the corresponding function cannot be used. The solution is to open php. INI file found; extension = php_mysql.dll changed

Extension = php_mysql.dll // remove the previous one to make it take effect.

3. the Mysql directory has no read permission. The correct directory permission is as follows:

Full administrator control
Full system control
Users read and run + list folder directories + Read
Delete all other user permissions, and restart MYsql and Web services.
(Note: The preceding settings do not have security settings. We recommend that you modify the settings and restart the server)
Important. Check php. check the permissions of the INI file, the permissions of the php file copied to system32, And the permissions of the php installation directory folder. at least users default permissions are required. the temp folder must have at least the users Group modification level permission.
However, all methods have been tried and cannot be solved, so I searched for mysql_connect () not supported,
Save the following code as phpinfo. php:
<? Php
Phpinfo ();
?>


If the iis environment is used, refer to the following solution:

Note the following when integrating IIS and PHP:
Install PHP
(1) decompress the downloaded php-5.1.4-win32.zip file and copy it:
X:/Server_Core/PHP;
(2) enter the X:/Server_Core/PHP folder and rename php. ini-dist to php. ini;
(3) Open the php. ini file and find:
Extension_dir = "./"
Change it;
Extension_dir = "X:/Server_Core/PHP/ext"
(4) find Windows Extensions.
In the dynamic module configuration under Windows Extensions, You need to enable the following module support: (remove the number before each line of the module configuration)
Extension = php_mbstring.dll
Extension = php_gd2.dll
Extension = php_mysql.dll
(5) find:
Disable_functions =
Changed:
Disable_functions =
Passthru, exec, system, popen, chroot, escapeshellcmd, escapeshellarg, shell_exec, proc_open, proc_get_status four of them:
--------------------------------------------------------------------------------

(4) find Windows Extensions.
In the dynamic module configuration under Windows Extensions, You need to enable the following module support: (remove the number before each line of the module configuration)
Extension = php_mbstring.dll
Extension = php_gd2.dll
Extension = php_mysql.dll -----> the above error is reported because the Semicolon ";" in front of this line is not removed. That is, remove the semicolon and restart the Apache server !!!

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.