利用BT配置服务器环境,安装Ngnix+PHP5.6+MySQL5.7;
在/www/server/panel/vhost/nginx目录下修改网站配置,如下:
server
{
listen 80;
server_name 需要解析的域名;
index index.php index.html index.htm default.php default.htm default.html;
root 网站目录;
client_max_body_size 40m;
gzip on;
gzip_static on;
gzip_types text/plain text/javascript text/css application/javascript ;
//以下为伪静态设置
rewrite ^/$ /program_school last;
location /program_school {
index index.html index.htm index.php;
try_files $uri $uri/ /index.php?$args;
}
location /android/ {
autoindex on;
}
location /zh-cn {
try_files $uri /index.php?$args;
}
location /blog {
index index.html index.htm index.php;
try_files $uri $uri/ /blog/index.php?$args;
}
#SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
#error_page 404/404.html;
#SSL-END
#ERROR-PAGE-START 错误页配置,可以注释、删除或修改
#error_page 404 /404.html;
#error_page 502 /502.html;
#ERROR-PAGE-END
#PHP-INFO-START PHP引用配置,可以注释或修改
include enable-php-56.conf;
#PHP-INFO-END
#REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
include /www/server/panel/vhost/rewrite/redapplereading.cn.conf;
#REWRITE-END
#禁止访问的文件或目录
location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
{
return 404;
}
#一键申请SSL证书验证目录相关设置
location ~ \.well-known{
allow all;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
error_log off;
access_log /dev/null;
}
location ~ .*\.(js|css)?$
{
expires 12h;
error_log off;
access_log /dev/null;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~* ^(?!(?:\/postfixadmin\/)).+\.(jpg|jpeg|gif|png|ico|pdf|ppt|bmp|rtf|css|txt|js|mp3|mp4|webm)(\?ver\=[\w\-]*)?$ {
etag off;
expires 365d;
}
location /postfixadmin/ {
root /www/wwwroot;
index index.html index.htm index.php;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /www/wwwroot$fastcgi_script_name;
include fastcgi_params;
}
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
网站路径/public$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;
}
location ~ /\.git {
deny all;
}
charset utf-8;
access_log /www/wwwlogs/网站目录.log;
error_log /www/wwwlogs/网站目录.error.log;
}
3. 开启MVC伪静态;
4.将Zend文件夹放到/www/server/php/56/lib/php下,在php中include_path中增加.:/www/server/php/56/lib/php,以便引用Zend扩展;
5.安装PHP扩展:redis、ZendGuardLoader、opcache、exif、intl、xsl;
6.建立网站数据库并导入数据;
7.重启服务器,完成zend framework网站配置。
联系客服