1.php环境

~]# vim /var/www/html/index.php(默认)
<?php
    phpinfo();
?>

LAMP通信测试_php


2.php和sql通信

~]# vim /var/www/html/index.php(默认)
<?php
    $link = mysql_connect('HOST','USERNAME','PASSWORD');
    if($link)
        echo "Success";
    else
        echo "Failure";
        
    mysql_close();
?>

LAMP通信测试_php_02

LAMP通信测试_sql_03