1. 程式人生 > >yum安裝lamp

yum安裝lamp

linux

程序下載鏈接:http://pan.baidu.com/s/1eSEgGM2

密碼:t8xl

安裝LAMP運行環境

yum install httpd,php,php-mysql,mysql-server,mysql

查看是否有php模塊

httpd -M

查看php安裝信息

rpm -ql php

啟動服務service httpd start

service httpd start

測試連接php是否成功,在/var/www/html中添加文件index.php

<?php

phpinfo();

?>

測試數據庫是否連接成功。

<?php

$link=mysql_connect(‘127.0.0.1‘,‘mysql‘,‘‘);

if ($link)

echo "Success";

else

echo "Failure";

mysql_close();

?>


部署

wordpress(個人博客)

unzip wordpress-4.8.1-zh_CN.zip

cp -r wordpress /var/www/html/

cd /var/www/html/wordpress

cp wp-config-sample.php wp-config.php

修改數據庫名等信息

創建MYsql用戶

GRANT ALL ON wpdb.* TO ‘wpuser‘@‘localhost‘ IDENTIFIED BY ‘wppasswd‘

GRANT ALL ON wpdb.* TO ‘wpuser‘@‘127.0.0.1‘ IDENTIFIED BY ‘wppasswd‘

CREATE DTABASE wpdb

FlUSH PRIVILEGES



phpmyadmin(mysql的圖像化管理程序)

cp config.sample.inc.php config.inc.php

生成隨機碼,填寫到cfg=[‘blowfish_secrest‘]=‘此處‘

tr -d ‘a-zA-Z0-9‘ < /dev/urandom | head -30 |md5sum

yum install php-mbstring(PHP處理多字節字符)

設置數據庫用戶密碼

SET PASSWORD FOR ‘root‘@‘localhost‘=PASSWORD(‘123456‘)

SET PASSWORD FOR ‘root‘@‘127.0.0.1‘=PASSWORD(‘123456‘)

FLUSH PRIVILEGES


yum安裝lamp