- Let PHP emit hi as a base
- Http://www.cnblogs.com/sows/p/5990157.html
- Configure Apache: /apache/conf/httpd.conf
-
- Create a PHP configuration file. /apache/php/
- Copying files
- Configure PHP.ini. /apache/php/php.ini
- Load MySQL
- Load path
- Start the MySQL service
- If mysql> can be displayed at the command line, the operation succeeds
- In Apache's default Web site directory, create mysql.php. /apache/htdocs/
- Create mysql.php
- Writing mysql.php
1<?PHP2 //1. Connect to the database3 $link=mysql_connect(' localhost ', ' root ', ' root ');4 5 //2. Determine if the database is connected successfully6 if($link){7 //If the connection succeeds, $link is a resource and the resource is automatically converted to a Boolean type (TRUE)8 Echo"Connection succeeded";9 } Ten Else{ One Echo"Connection Failed"; A } -?>
- Open Browser, enter http://localhost/mysql.php
- See if you succeed
[Wind Horse clan _php] PHP connects to MySQL