本文共 2223 字,大约阅读时间需要 7 分钟。
yum install yum-utilsTo set up the yum repository, create the file named /etc/yum.repos.d/nginx.repo with the following contents:[nginx-stable]name=nginx stable repobaseurl=http://nginx.org/packages/centos/$releasever/$basearch/gpgcheck=1enabled=1gpgkey=https://nginx.org/keys/nginx_signing.key[nginx-mainline]name=nginx mainline repobaseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/gpgcheck=1enabled=0gpgkey=https://nginx.org/keys/nginx_signing.keyyum-config-manager --enable nginx-mainlineyum install nginxsystemctl status nginxsystemctl start nginxsystemctl enable nginx
systemctl stop firewalld.servicesystemctl disable firewalld.service
[root@localhost ~]# getenforceEnforcing[root@localhost ~]# setenforce 0[root@localhost ~]# getenforcePermissive
[root@localhost ~]# vim /etc/sysconfig/selinuxSELINUX=enforcing 改为 SELINUX=disabled#重启服务reboot
[root@localhost conf.d]# yum -y install php-fpm php-mbstring php-gd[root@localhost conf.d]# systemctl status php-fpm[root@localhost conf.d]# systemctl restart php-fpm[root@localhost conf.d]# systemctl enable php-fpm
wget http://static.kodcloud.com/update/download/kodexplorer4.39.zip
cd /data/kodexplorerunzip kodexplorer4.39.zip
server { listen 80; server_name localhost; root /data/kodexplorer/; index index.html index.htm index.php; location ~ \.php$ { root kodexplorer; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME /data/kodexplorer$fastcgi_script_name; include fastcgi_params; } }
vim /etc/php.ini#在最后一行extension=mbstring.soextension=php_gd2.dll:wq!#保存退出即可#重启php-fpm服务systemctl restart php-fpm
1、php的index.html无法访问,SElinux没有关闭导致;
2、是由于php-mbstring php-gd没有安装,并且php.ini没有添加配置(如上<新增加php配置>),图片无法加载‘
3、nginx无法访问到,是由于nginx配置不对,如下修改:
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;fastcgi_param SCRIPT_FILENAME /data/kodexplorer$fastcgi_script_name;
转载地址:http://vyell.baihongyu.com/