[英]Nginx Wave Framework API configuration issue - WARNING: Nginx HttpRewriteModule is not supported
我搜索了几天,并通过反复试验尝试了各种配置,但我无法更正我的配置。 我的专长是数据库设计和开发,因此服务器配置一直充满挑战。
我在LEMP堆栈上,并安装了Wave Framework。 Wave是一种PHP微框架,它是按照模型视图控制体系结构和工厂方法设计模式宽松构建的, 网址为http://www.waveframework.com/wave/doc/index.htm
出人意料的是,进入服务器非常容易,但是我无法解决一个问题。 在我的服务器上,将Wave添加到我的nginx配置文件中的行中,Wave建议,但仍然收到警告“警告:不支持Nginx HttpRewriteModule,索引网关和重写功能将不起作用,如果不使用索引网关,则可以忽略此警告用过的”
除此之外,我还能够使用Wave框架的许多功能,并对我的模型和控制器进行了编码。
请帮助,我的配置粘贴在下面。
nginx.conf
用户www-data;
worker_processes 4;
pid /run/nginx.pid;
事件{
worker_connections 768; }
http {
发送文件
tcp_nopush on;
tcp_nodelay;
keepalive_timeout 65;
types_hash_max_size 2048;
rewrite_log on;
包括/etc/nginx/mime.types;
default_type应用程序/八位字节流;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable“ msie6”;
包括/etc/nginx/conf.d/*.conf;
包括/ etc / nginx / sites-enabled / *;
}
/ etc / nginx / sites-enabled / default(我更改了域名)
服务器{收听80;
root /usr/share/nginx/www; index index.php; server_name *.example.com;
#这是为了确保/ resources / static /文件夹中的文件不会被PHP解析
位置^〜/ resources / static / {
break;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/www; }
#重写,将除PHP以外的所有内容定向到索引文件
#确保将其放置在服务器配置的“〜〜.php $ {”之前。
位置 / {
rewrite ^(.*)$ ./index.php last;
}
#将php脚本传递给php引擎
location ~ \\.php$ { try_files $uri =404; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params;
}}
http://www.example.com/tools/compatibility.php (我的域的输出-wave框架)
成功:PHP为5.3.0或更高版本(运行5.5.9-1ubuntu4.3)
成功:启用PHP设置short_open_tag
成功:支持PDO
成功:支持PDO MySQL
...
警告:不支持Mcrypt PHP扩展,这是可选的,仅在通过www-crypt-input和www-crypt-output请求发出API请求时使用
成功:支持邮政编码
成功:支持FTP
警告:不支持Memcache,如果您不打算将Memcache作为缓存层,则可以将其忽略
成功:支持GD图形库
成功:使用了Nginx服务器
警告:不支持Nginx HttpRewriteModule,索引网关和重写功能将不起作用,如果不使用索引网关,则可以忽略此警告
成功:/ filesystem /是可写的
成功:/ filesystem / cache /可写
...
成功:/ filesystem / data /可写
我不担心HttpRewriteModule以外的其他警告,谢谢!
因此,我(在帮助下)回答了我自己的问题。 任何尝试使用Nginx的Wave Framework的人都会遇到这种情况(至少在当前版本3.7.1中)。 Wave Framework在Nginx HTTPrewriteModule和配置文件中存在一个错误,供您实施到Nginx配置中的配置文件是错误的。 以下是适用于我的我的etc / nginx / sites-enabled / default配置文件。
# this file is /etc/nginx/sites-enabled/default
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
access_log /var/log/nginx/default/access.log;
error_log /var/log/nginx/default/error.log;
root /var/www/default;
index index.php index.html index.htm;
# domain names of this vhost (important if there are more
# than one vhost on the same IP:PORT combination)
server_name localhost mydomain.com alias.mydomain.com;
# deny access to .htaccess files
location ~ /\.ht {
deny all;
}
# deny access to hidden files, that is the ones which names that start
# with . (dot)
location ~ /\. {
deny all;
}
# This is for making sure that files in /resources/static/ folder don't get parsed with PHP
location ^~ /resources/static/ {
break;
}
# Uncomment to satisfy compatibility check for Nginx rewrite module
# (based on .htaccess delivered with Wave Framework)
# location ~ compatibility\.php$ {
# if ($query_string != rewrite_enabled) {
# rewrite ^(.*)$ $1?rewrite_enabled break;
# }
# fastcgi_pass unix:/var/run/php5-fpm.sock;
# fastcgi_index index.php;
# include fastcgi_params;
# }
location / {
rewrite ^(.*)$ /index.php last;
}
# Uncomment if you have a custom 404 page
#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 /usr/share/nginx/html;
}
# pass the PHP scripts to FastCGI server
location ~ \.php$ {
# fastcgi_split_path_info ^(.+\.php)(/.+)$;
# # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.