CentOS下的PHP 環(huán)境配置 VMware + CentOS + PHP5.4 +apach

1.下載VMWare  點(diǎn)擊地址鏈接:http://pan.baidu.com/s/1nvrns5j 密碼:uyzz(版本包含 9 或11或者12)

在CentOS 7.2 環(huán)境下安裝

2.CentOS 系統(tǒng) 7.2 地址下載

3.LAMP環(huán)境的快速搭建推薦鏈接:

在CentOS 6.5環(huán)境下安裝

(1)啟動(dòng)Apache 出現(xiàn)的問(wèn)題

1.出現(xiàn)問(wèn)題:連不上網(wǎng)絡(luò) 。鏈接可看下設(shè)置CentOS_7的網(wǎng)絡(luò)
或者修改vi /etc/sysconfig/network-scripts/ifcfg-(自己的網(wǎng)卡)設(shè)置BOOTPROTO=static為靜態(tài)

2.網(wǎng)絡(luò)不通。 測(cè)試:ping www.baidu.com 發(fā)現(xiàn)網(wǎng)絡(luò)不通。
查看是否有網(wǎng)卡,如果沒(méi)有。則需要打開(kāi)

Paste_Image.png

vi /etc/sysconfig/network-scripts/ifcfg-enoxxxxxx。
更改這部分
ONBoot = yes
Service network restart 重新啟動(dòng)服務(wù)

Paste_Image.png

3.遠(yuǎn)程web瀏覽器無(wú)法打開(kāi)頁(yè)面
測(cè)試centos 是否打開(kāi)apache curl localhost
修改防火墻端口號(hào):
查看當(dāng)前配置:iptables -L
防火墻配置文件:
vi /etc/sysconfig/iptables
開(kāi)放80端口:
iptables -A INPUT -p tcp -s 0/0 --dport 8180 -j ACCEPT
重啟服務(wù):
/etc/rc.d/init.d/iptables restart
啟動(dòng)和停止服務(wù)分別用start、stop
chkconfig –level 2345 iptables off
service iptables stop不推薦關(guān)閉防火墻

  1. 重啟后生效
Paste_Image.png

(2)啟動(dòng)mysql 和配置相關(guān)命令
出現(xiàn)錯(cuò)誤:mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: YES)'
原因 mysql登錄錯(cuò)誤

解決辦法

composer update 失敗 :之前要 執(zhí)行composer global require ”fxp/composer-asset-plugin:1.
或者 php composer.phar global require “fxp/composer-asset-plugin:1.

然后 composer update

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容