- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经搜索了几天并通过反复试验尝试了各种配置,但我无法更正我的配置。我的专长是数据库设计和开发,所以服务器配置一直很有挑战性。
我在 LEMP 堆栈上并安装了 Wave 框架。 Wave 是一个 PHP 微框架,它松散地遵循模型- View -控制架构和工厂方法设计模式构建
http://www.waveframework.com/wave/doc/index.htm
令人惊讶的是,它很容易进入您的服务器,但是我无法解决一个问题。在我的服务器上,我在我的 nginx 配置文件中添加了 Wave 建议的行,但我仍然收到警告“警告:不支持 Nginx HttpRewriteModule,索引网关和重写功能将不起作用,如果索引网关不可用,则可以忽略此警告用过的”
除此之外,我已经能够使用 Wave 框架的许多特性,并且对我的模型和 Controller 的一部分进行了编码。
请帮忙,我的配置粘贴在下面。
nginx.conf
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768; }
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
rewrite_log on;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
server { listen 80;
root /usr/share/nginx/www;
index index.php;
server_name *.example.com;# This is for making sure that files in /resources/static/ folder don't get parsed with PHP
location ^~ /resources/static/ {
break;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/www;
}# Rewrite that directs everything, except PHP to index file
# Make sure you place this before your "location ~ .php$ {" for the server configuration.
location / {
rewrite ^(.*)$ ./index.php last;
}
# Pass php scripts to the php engine
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;} }
SUCCESS: PHP is version 5.3.0 or above (running 5.5.9-1ubuntu4.3)
SUCCESS: PHP setting short_open_tag is enabled
SUCCESS: PDO is supported
SUCCESS: PDO MySQL is supported
...
WARNING: Mcrypt PHP extension is not supported, this is optional and used only when API requests are made with www-crypt-input and www-crypt-output requests
SUCCESS: Zip is supported
SUCCESS: FTP is supported
WARNING: Memcache is not supported, this can be ignored if you do not intend to support Memcache as a caching layer
SUCCESS: GD Graphics Library is supported
SUCCESS: Nginx server is used
WARNING: Nginx HttpRewriteModule is not supported, Index Gateway and rewrite functionality will not work, this warning can be ignored if Index Gateway is not used
SUCCESS: /filesystem/ is writable
SUCCESS: /filesystem/cache/ is writable
...
SUCCESS: /filesystem/data/ is writable
最佳答案
所以我(在帮助下)回答了我自己的问题。任何尝试使用 Nginx 的 Wave Framework 的人都会遇到这种情况(至少在 3.7.1 当前版本中)。 Wave 框架在 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;
}
}
关于php - Nginx Wave 框架 API 配置问题 - 警告 : Nginx HttpRewriteModule is not supported,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24833854/
我已经搜索了几天并通过反复试验尝试了各种配置,但我无法更正我的配置。我的专长是数据库设计和开发,所以服务器配置一直很有挑战性。 我在 LEMP 堆栈上并安装了 Wave 框架。 Wave 是一个 PH
我是一名优秀的程序员,十分优秀!