centos7 php开发环境安装

Posted 微刻时光

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos7 php开发环境安装相关的知识,希望对你有一定的参考价值。

准备工作

防火墙

   systemctl status firewalld        看到active(running)就意味着防火墙打开了

   systemctl stop firewalld          看到inactive(dead)就意味着防火墙关闭了

   systemctl start firewalld          打开防火墙

   systemctl disable firewalld        重启后防火墙还是处于关闭的状态

   systemctl enable firewalld        重启不会恢复到原来的状态

   systemctl restart firewalld.service  重启防火墙

 

防火墙端口开放与关闭

    firewall-cmd --zone=public --add-port=80/tcp --permanent

    firewall-cmd --zone=public --add-port=443/tcp --permanent

    firewall-cmd --zone=public --add-port=22/tcp --permanent

   firewall-cmd --zone=public --add-port=21/tcp --permanent

   firewall-cmd --zone=public --add-port=53/udp --permanent

 

  firewall-cmd --zone=public --remove-port=80/tcp --permanent

  firewall-cmd --zone=public --remove-port=443/tcp --permanent

  firewall-cmd --zone=public --remove-port=22/tcp --permanent

  firewall-cmd --zone=public --remove-port=21/tcp --permanent

  firewall-cmd --zone=public --remove-port=53/udp --permanent

 

  firewall-cmd --zone=public --add-port=4400-4600/udp --permanent

  firewall-cmd --zone=public --add-port=4400-4600/tcp --permanent

 

netstat -ntlp            //查看当前所有tcp端口·

netstat -ntulp |grep 80   //查看所有80端口使用情况·

netstat -an | grep 3306   //查看所有3306端口使用情况·

查看一台服务器上面哪些服务及端口

netstat  -lanp

查看一个服务有几个端口。比如要查看mysqld

ps -ef |grep mysqld

查看某一端口的连接数量,比如3306端口

netstat -pnt |grep :3306 |wc

查看某一端口的连接客户端IP 比如3306端口

netstat -anp |grep 3306

netstat -an 查看网络端口

 

 

更新yum源 常用安装依赖

yum install epel-release  -y

yum update

yum install -y gcc gcc-c++ pcre pcre-devel openssl openssl-devel zlib zlib-devel

yum -y install ncurses-devel

yum -y install wget vim pcre pcre-devel openssl openssl-devel libicu-devel gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel ncurses ncurses-devel curl curl-devel krb5-devel libidn libidn-devel openldap openldap-devel nss_ldap jemalloc-devel cmake boost-devel bison automake libevent libevent-devel gd gd-devel libtool* libmcrypt libmcrypt-devel mcrypt mhash libxslt libxslt-devel readline readline-devel gmp gmp-devel libcurl libcurl-devel openjpeg-devel

以上是关于centos7 php开发环境安装的主要内容,如果未能解决你的问题,请参考以下文章

centos7 php开发环境安装-mysql

linux centos7 下安装 php开发环境 (初学)

centos7 php开发环境安装-Git

centos7 php开发环境安装-composer

centos7 php开发环境安装-Nginx

centos7 php开发环境安装--配置SSL(Apache为例)