Windows PHP Connection not on MySQL workaround _php tutorial

Source: Internet
Author: User
Fire Building Station College (bkjia.com) documentationPHP is not connected to MySQL. Test connection mysql hint ' Fatal error:call to undefined function mysql_connect () "Environment J Yes: Windows XP SP2 en, apache2.2,mysql 5.1rc.php5.28.

According to the configuration of NetEase technology configuration completed. Use Phpinfo () to view. No MySQL is found ..., but the DOS window is normal for MySQL. And then. Just look back and forth is the problem there.
All the methods of http://www.somacon.com/p109.php on this page are also

Then read the log. Reload. Repeatedly set php.ini,my.ini,apache.conf, the result still did not catch up with her. My brain is really hard to turn. Then there is no way ... Just use adminphp to see if you can connect, but tip "cannot load MySQL extension. Please check your PHP configuration ". I feel like I'm Mr. Bean.

This hint, could it be that PHP was not loaded into the library file connected to MySQL? After you start Apache server. I try to remove the ' php5ts.dll ' and ' Libmysql.dll '. The prompt cannot be removed. Indicates that a program is using both library files. The description is loaded. (There are, of course, many ways to test.) For example, you can use some software to view all library files loaded by the program service. Also the AP is also said to be php.ini setup has a problem. Then I don't look at anything else. I'll focus on the php.ini configuration.

In the absence of superstition php.ini is correct. Finally found that the php.ini in this line.

Phpinidir "Your PHP directory"
# (ex: Phpinidir "c:/php")

Restart Apache server, and then. Use the usual methods on the Internet

The following is the referenced content:
$link =mysql_connect (' localhost ', ' username ', ' password ');
if (! $link) echo "Failed!";
else echo "Success!";
Mysql_close ();
?>

Let's test it. My php.ini configuration

That's it, it took a lot of time. I was also the first to bump into this problem. Can only indicate "fate" is "fate" Ah!

Attention:
On the same machine. If you have previously installed. Apache. Or the installation is not in the same directory. and more than one version. Before installing MYSQL5.1RC. Better Clean Up your registry

Some other configuration tutorials. Say to copy 2 DLL files to System32, in fact, by the above 163 tutorial. Because environment variables are set, they are not required. If you've ever copied it, delete it.

The following is the referenced content:
En version:
Problem:

If something wrong with ' Fatal error:call to undefined function mysql_connect () ... ' or

' Cannot load MySQL extension. Please check the your PHP configuration ' while your test resolve:
Add New line like:
Phpinidir "#your php root Fold"
(E.g:phpinidir "c:/php")
In php.ini file
Restart servers
See.ok
If unlock its again. Link bellow:
http://www.somacon.com/p109.php

http://www.bkjia.com/PHPjc/364238.html www.bkjia.com true http://www.bkjia.com/PHPjc/364238.html techarticle Fire Building Station College (liehuo.net) document PHP is not connected to MySQL. Test connection mysql hint ' Fatal error:call to undefined function mysql_connect () Environment J Yes: windows XP SP2 en, Apach ...

  • 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.