nginx 安装
yum install -y nginx
sudo systemctl start nginx.service
sudo systemctl enable nginx.service
mysql 安装
wget http:
yum -y install mysql-community-release-el7-5.noarch.rpm
yum -y install mysql-community-server
systemctl start mysqld.service
systemctl status mysqld.service
systemctl list-unit-files|grep enabled
sudo systemctl enable mysql.service
sudo systemctl enable mysqld.service
mysql -uroot -p
set password for root@localhost = password('361654768');
sudo firewall-cmd --zone=public --add-port=3306/tcp --permanent
service firewalld restart
grant all privileges on *.* to root@'%' identified by 'root';
FLUSH PRIVILEGES;
php安装
1:下载对应的仓库
yum install -y https:
yum install -y https:
2.安装yum-utils,一个常用工具包,安装了yum-utile,才能使用yum-config-manager命令
yum -y install yum-utils
3.启用对应php版本仓库,我使用的是php72
yum-config-manager --enable remi-php72
yum repolist all | grep php
4.安装php
yum install -y php php-fpm
php -v
php -m
5. 添加开机自启动
systemctl enable php-fpm.service
6.修改时区
vim /etc/php.ini
找到 date.timezone 给前面的 ; 去掉,=PRC
7.重启
systemctl reload php-pfm
nginx 配置
server {
listen 10101;
server_name 192.186.3.1;
index index.php;
root /data/www/juhui;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
在 /data/www/juhui 下创建 index.php
<?php phpinfo(); ?>
git 安装
yum -y install git
redis及其扩展安装
yum -y install redis php-redis
systemctl start redis.service
systemctl stop redis.service
systemctl restart redis.service
systemctl status redis.service
mongodb及扩展安装
vim /etc/yum.repos.d/mongodb-org-3.4.repo
[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https:
gpgcheck=1
enabled=1
gpgkey=https:
yum install -y mongodb-org
vi /etc/mongod.conf
systemctl start mongod.service
systemctl stop mongod.service
systemctl restart mongod.service
systemctl enable mongod
mongo 127.0.0.1:27017
pecl install mongodb
extension=mongodb.so;
安装其他扩展
yum -y install php-mysqlnd php-pdo php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-soap curl curl-devel
安装 bc库
yum -y install php-bcmath