gpt4 book ai didi

php - 如何在 Nginx 配置文件中配置 Phalcon

转载 作者:可可西里 更新时间:2023-10-31 22:44:23 25 4
gpt4 key购买 nike

我正在尝试设置 NGINx 服务器以使用 Phalcon PHP 框架。到目前为止,我一直在互联网上寻求帮助,但找不到任何东西......

我的配置文件是:

server {
#listen 80; ## listen for ipv4; this line is default and implied
#listen [::]:80 default ipv6only=on; ## listen for ipv6

root /usr/share/nginx/www;
index index.php index.html index.htm;

# Make site accessible from http://localhost/
server_name localhost;

location / {
# First attempt to serve request as file, then
# as directory, then fall back to index.html
try_files $uri $uri/ /index.html;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}

location /doc/ {
alias /usr/share/doc/;
autoindex on;
allow 127.0.0.1;
deny all;
}

为了使 Phalcon 工作,应该添加什么?谢谢。

最佳答案

I faced the same problem and finally got this working here is my configuration file using Windows 7 and PHP 5.3 in Fast CGI mode.

server {
listen 80;
server_name localhost;
set $root_path 'C:/devtools/phalcon/test/public';
root $root_path;
index index.php index.html index.htm;
try_files $uri $uri/ @rewrite;
location @rewrite {
rewrite ^/(.*)$ /index.php?_url=/$1;
}

location ~ \.php {
try_files $uri =404;

fastcgi_index /index.php;
fastcgi_pass 127.0.0.1:9123; #default is 9000, i am using 9123
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
root $root_path;
}

location ~ /\.ht {
deny all;
}
}

关于php - 如何在 Nginx 配置文件中配置 Phalcon,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17526633/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com