1.安装php
yum install php php-fpm php-mysql -y
启动
service php-fpm start
或
systemctl start php-fpm
2.解压Discuz_X3.4_SC_UTF8【20191201】.zip并复制到/home/www/discuz/public目录
unzip Discuz_X3.4_SC_UTF8【20191201】.zip
cp -r upload/* /home/www/discuz/public
chmod -R 777 /home/www/discuz/public
3.nginx配置:
http {
include mime.types;
default_type application/octet-stream;
gzip on;
gzip_min_length 1024;
gzip_types text/css application/x-javascript application/vnd.api+json;
gzip_disable “MSIE [1-6].”;
gzip_comp_level 2;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name localhost;
root /home/www/discuz/public;
index index.php;
#charset koi8-r;
#access_log logs/host.access.log main;
#location / {
# try_files $uri $uri/ /index.php?$query_string;
#}
location ~ .php$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/www/discuz/public$fastcgi_script_name;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ .php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ .php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
4.访问IP/install地址
我同意,下一步。
下一步
下一步
如果数据库服务器端口不是3306那么我们就填ip:端口。