- I built the lamp on Linux and I tested Apache + PHP earlier.
- Create a PHP test under the/var/www/html/directory phpinfo.php
[[email protected] ~]# cd/var/www/html/// Enter httpd default Site directory [[email protected] html]# vim phpinfo.php // Create and edit phpinfo.php<?phpphpinfo ();? >
- and tested Php+mysql.
- Create a PHP connection to MySQL test file under the/var/www/html/directory mysql_connect_db.php
[[email protected] html]# vim mysql_connect_db.php //Create and edit Mysql_connect_db.php<?php$link = mysql_connect (' 192.168.1.190 ', ' root ', ' root '), if (! $link) {die (' Connection failed: '. mysql_error ());} Else{echo ' connection succeeded ';} Mysql_close ($link);? >
- Problems encountered and their solutions
- When I write good mysql_connect_db.php save and exit
- Access, see the effect, the following error
- Above error obvious password error
- Another situation
- Access, see the effect, the following error
[[email protected] ~]# Setenforce 0 //temporarily off SELinux
Test PHP connection MySQL