centos7配置LAMP過程問題及解決

防火牆

這裏寫圖片描述

採用centos7的防火牆命令:

開啓:systemctl start firewalld
關閉:systemctl stop firewalld
重啓:systemctl restart firewalld
現在狀態:firewall-cmd –state

開放端口:sudo firewall-cmd –zone=public –add-port=3000/tcp –permanent
重啓:sudo firewall-cmd –reload

禁止firewalld開機啓動: systemctl disable firewalld

採用傳統命令:

安裝老版本防火牆:

yum install iptables-services
設置開機啓動:
systemctl enable iptables
常用命令:
systemctl [stop|start|restart|reload] iptables(分開執行)
保存設置:
service iptables save 或者 /usr/libexec/iptables/iptables.init save
也可以參考下這個的設置

Mysql初始化

錯誤:-bash: /php/server/mysql/scripts/mysql_install_db: /usr/bin/perl: bad interpreter: No such file or directory
這裏寫圖片描述
原因:依賴缺失
解決

yum -y install perl perl-devel

錯誤:FATAL ERROR: please install the following Perl modules
before executing /php/server/mysql/scripts/mysql_install_db:
Data::Dumper
這裏寫圖片描述
原因:缺失依賴
解決:yum install -y perl-Data-Dumper

Aphche

問題:
解壓.gz2

tar: bzip2: Cannot exec: No such file or directory
tar: Error is not recoverable: exiting now
tar: Child returned status 2
這裏寫圖片描述
解決:
.原因分析:
未安裝bzip2導致
解決安裝bzip2軟件
yum install bzip2

png配置no

這裏寫圖片描述
原因分析:不能自動找到png路徑
解決:給配置項添加上路徑
–with-png=/php/server/png

安裝GD庫時png.h找不到

這裏寫圖片描述

解決:
vi gd_png.c

include “png.h”
替換成:
include “(png的安裝路徑)/include/png.h”
然後再make就可以了
解決2:
yum install libpng libpng-devel

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章