I run a php-based web site (shopping mall) on nginx web server. recently I heard that phalcon is very fast and reliable framework, helping developer speed up the dev process.
So I wanted to implement it to my site, starting as a submodule for specific services for it's hard to start from the scratch.
I want to create a subfolder (let's say "phalcontest") under the /var/www .
I googled about this topic, but all(maybe?) the contents I found on the net were to set nginx server as a dedicated site for phalcon project (I mean, make "the project" folder as a web root), nothing about making phalcon project coexist with old non-phalcon pages.
I tried nginx configuration something like this, hoping it's ok:
server {
listen 80;
root /var/www/;
index index.html index.htm index.php;
server_name localhost;
access_log /var/log/nginx/access.log main buffer=16k;
error_log /var/log/nginx/error.log;
location @rewrite {
rewrite ^(.*)$ phalcontest/index.php?_url=$1;
}
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ~ \.php$ {
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
}
location /phalcontest {
try_files $uri $uri/ @rewrite;
}
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
root /var/www/;
}
}
to make "phalcontest" folder to be a phalcon-enabled subfolder under webroot.
After that I created phalcontest with phalcon devtools,
and accessed http://localhost/phalcontest/public, it shows:
Congratulations! You're now flying with Phalcon. Great things are about to happen! This page is located at views/index/index.phtml
but when I accessed http://localhost/phalcontest, it shows:
Mod-Rewrite is not enabled
Please enable rewrite module on your web server to continue
this means that I've done something wrong and I can only access via public folders, not the folder itself.
Please help me how to let phalcon live with existing php-based site!