PHP cannot load the Mysql database correctly,

Source: Internet
Author: User
PHP cannot load the Mysql database correctly !!! Various software versions: apache: 2.2.22PHP: 5.2.17 & nbsp; Mysql: 5.5.23 now apache can parse the. php file normally, but phpinfo () cannot display and load the mysql database correctly. My php. ini is placed in the php Installation Path. the configuration is: extension_dir & quot;. ext & qu PHP cannot load the Mysql Library correctly !!!
Software versions:
Apache: 2.2.22
PHP: 5.2.17
Mysql: 5.5.23

Now apache can parse the. php file normally, but phpinfo () cannot correctly display and load the mysql database.
Put my php. ini in the php Installation Path. the configuration is as follows:
Extension_dir = "./ext"
Extension = php_mysql.dll

./Ext does have the php_mysql.dll file.
Later, I checked on the Internet and said that the php_mysql.dll file was to be added to system32. then I copied a copy of the file, but it still didn't work.

New to me, I used to use AppServ for the first time. I haven't finished it for half a day. please help me! Thank you !!!

------ Solution --------------------
Check whether the php. ini path in phpinfo is modified. In addition, not only does php_mysql.dll need to be copied, but also libmysql. dll.
It also needs to be copied to system32. Give it a try. in win, the configuration environment has become quite unfamiliar...

------ Solution --------------------
In the window environment
1. do not copy any files (Green installation)
Because apache, php, and mysql can run without relying on the registry.

2. the module-based php extension_dir should use an absolute path (do not use a drive letter). The relative path./ext is used for php.exe.
Otherwise, the php5apache2_2.dll in the memory will not find the corresponding directory and cannot instruct php5ts. dll to load the extension Library.

3. configure basic php parameters in apache (replace the path with your actual path)
PHPIniDir "/AMP/php536"
LoadFile "/AMP/php536/php5ts. dll"
LoadModule php5_module "/AMP/php536/php5apache2_2.dll"
Addtype application/x-httpd-php. php

4. standby knowledge:
Set
Apache is installed under/AMP/apache2.
Mysql is installed with/AMP/mysql
Then copy the/AMP to the USB flash drive to make the environment portable.
Run at startup
Start/B "Apache" "\ AMP \ apache2 \ bin \ httpd.exe"
Start/B "Mysql" "\ AMP \ mysql \ bin \ mysqld.exe" -- defaults-file = "\ AMP \ mysql \ my. ini"
Executed when stopped
Tskill httpd
Tskill mysqld

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.