从0到1搭建redis6.0.7续更~( 二 )


默认用户www-data[root@mysql_master ~]# id www-dataid: www-data: no such user[root@mysql_master ~]# groupadd www-data[root@mysql_master ~]# useradd -g www-data www-data[root@mysql_master ~]# id www-datauid=1001(www-data) gid=1001(www-data) groups=1001(www-data)9.修改php-fpm
[root@mysql_master ~]# vim /etc/php-fpm.d/www.confuser=www-datagroup=www-data10.修改Nginx配置
[root@mysql_master ~]# yum -y install nginx[root@mysql_master ~]# rm -rf /etc/nginx/nginx.conf[root@mysql_master ~]# cp /etc/nginx/nginx.conf.default /etc/nginx/nginx.conf[root@mysql_master ~]# vim /etc/nginx/nginx.conf修改为以下内容location ~ \.php$ {roothtml;fastcgi_pass127.0.0.1:9000;fastcgi_indexindex.php;fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;includefastcgi_params;}11.写测试页面
[root@mysql_master ~]# systemctl restart nginx[root@mysql_master ~]#cd /usr/share/nginx/html/[root@mysql_master html]# vim index.php#写以下内容<?phpphpinfo();?>#重启服务[root@mysql_master html]# systemctl restart nginx php-fpm12.验证PHP是否能正常启动成功
#浏览器访问:http://192.168.232.11/index.php//这里写自己的配PHP的主机和PHP名称#往下找看看能否找到redis模块,出现如下信息即配置成功13.测试
连接哪个redis,应该先开启,否则出现访问拒绝[root@mysql_master html]# vim redis.php<?php//连接192.168.232.12的Redis服务$redis = new Redis();$redis->connect('192.168.232.11',7000);$redis->auth (''); //redis认证echo "connection to server sucessfully";//查看服务是否运行echo "server is running: " . $redis->ping();?>好了,到这里我们PHP客户端的redis已搭建起来,想要了解更多redis内容,可以关注私信我,有问题也可以私信我,redis我还会继续更新,感觉写的不错的话点个赞吧~
喜欢就点个关注叭~
转载请注明出处,持续更新ing...如有问题可以发我邮箱2325117110@qq.com
【从0到1搭建redis6.0.7续更~】

经验总结扩展阅读