在Centos7下使用yum快速搭建Lnmp(Nginx+PHP+Mysql)开发环境.
第一步:安装Nginx
在终端执行命令:
yum install nginx
这一步完成之后,就可以通过ip访问,比如范围:112.12.125.12,就可以看到nginx的默认页面了
第二步:安装Mysql
第三步:安装PHP
添加源:
yum install epel-release
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
安装:
yum install --enablerepo=remi --enablerepo=remi-php56 php php-fpm php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof php-pdo php-openssl php-curl
如果后面有需要安装新的扩展,可以使用下面命令
yum install --enablerepo=remi --enablerepo=remi-php56 php-gd
使用命令:
Nginx:
service nginx stop|start|restart|reload
Mysql:
service mysqld stop|start|restart
PHP:
service php-fpm stop|start|restart