yum方式下快速安装php7.1
安装nginx
yum install nginx##开启nginxservice nginx start123
安装MYSQL
yum localinstall http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpmyum install mysql-community-server//开启mysqlservice mysqld start//查看mysql的root账号的密码grep 'temporary password' /var/log/mysqld.log//登录mysql mysql -uroot -p//修改密码 ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';//修改root用户可远程登录 GRANT ALL PRIVILEGES ON . TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;//刷新 flush privileges;123456789101112131415161718192021
安装php
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpmrpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm//查看 yum search php71w//安装php以及扩展 yum install php71w php71w-fpm php71w-cli php71w-common php71w-devel php71w-gd php71w-pdo php71w-mysql php71w-mbstring php71w-bcmath//开启服务service php-fpm start//修改/etc/nginx/nginx.conf 使其支持php 见下 //重启nginxservice nginx restart12345678910111213141516
———————配置
server {charset utf-8;client_max_body_size 128M;listen 80; ## listen for ipv4server_name localhost;root /var/www/;index index.php;location / {if (!-e $request_filename){rewrite ^/(.)$ /index.php/$1 last;}try_files $uri $uri/ /index.php?$args;}location ~ .php$ {include fastcgi.conf;fastcgi_pass 127.0.0.1:9000;try_files $uri =404;}location ~ .php {fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;include /etc/fastcgi_params;fastcgi_split_path_info ^(.+.php)(/?.)$;fastcgi_param SCRIPT_FILENAME fastcgi_param PATH_INFO $fastcgi_path_info;fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;}error_page 404 /404.html;location ~ /.(ht|svn|git) {deny all;}}12345678910111213141516171819202122232425262728293031323334353637
安装redis
yum install redis //修改配置 vi /etc/redis.conf //daemonize yes 后台运行 //appendonly yes 数据持久化service redis start123456
安装php-redis扩展
//先装git yum install git//git下扩展cd /usr/local/srcgit clone https://github.com/phpredis/phpredis.git//安装扩展cd phpredis phpize//修改php配置vi /etc/php.ini 添加extension=redis.so//重启phpservice php-fpm restart
赞 (0)