【发布时间】:2014-09-10 02:44:23
【问题描述】:
我已经搜索了几天并通过反复试验尝试了各种配置,但我无法更正我的配置。我的专长是数据库设计和开发,所以服务器配置一直很有挑战性。
我在 LEMP 堆栈上,我安装了 Wave 框架。 Wave 是一个 PHP 微框架,它松散地遵循模型-视图-控制架构和工厂方法设计模式构建 http://www.waveframework.com/wave/doc/index.htm
令人惊讶的是,它很容易进入您的服务器,但是我无法解决一个问题。在我的服务器上,我在我的 nginx 配置文件中添加了 Wave 建议的行,但我仍然收到警告“警告:不支持 Nginx HttpRewriteModule,索引网关和重写功能将不起作用,如果索引网关不可用,则可以忽略此警告用过”
除此之外,我还能够使用 Wave 框架的许多功能,并且对我的模型和控制器的一部分进行了编码。
请帮忙,我的配置贴在下面。
nginx.conf
用户 www-data;
worker_processes 4;
pid /run/nginx.pid;
事件{
worker_connections 768; }
http {
发送文件;
tcp_nopush 开启;
tcp_nodelay 开启;
keepalive_timeout 65;
types_hash_max_size 2048;
rewrite_log on;
包括/etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip 开启;
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 请求时使用
成功:支持 Zip
成功:支持 FTP
警告:不支持 Memcache,如果您不打算支持 Memcache 作为缓存层,可以忽略这一点
成功:支持 GD 图形库
成功:使用了 Nginx 服务器
警告:不支持 Nginx HttpRewriteModule,索引网关和重写功能将不起作用,如果不使用索引网关,可以忽略此警告
成功:/filesystem/ 是可写的
成功:/filesystem/cache/ 是可写的
...
成功:/filesystem/data/ 是可写的
我不担心 HttpRewriteModule 之外的其他警告 提前谢谢!
【问题讨论】:
标签: php web-services ubuntu nginx web-frameworks