Can not set up PHPCI on local machine

1,113 views
Skip to first unread message

Alexander Kurinniy

unread,
Jul 15, 2013, 4:52:55 PM7/15/13
to php...@googlegroups.com
Hi all.

Project looks interesting, so I'm trying to play around with it on localhost but can not get it running. I'm using typical ubuntu setup: nginx, php-fpm and mysql.

My virtual host is http://phpci.local. When I access it from browser, it redirects to http://phpci.local/session/login and this localtion returns 404 error (File not found).

My nginx config as follows:

server {
        listen   80;
        root /home/skynet/work/phpci/PHPCI;
      
        server_name phpci.local;

        location / {
                try_files $uri $uri/ index.php;
                index index.php;
        }

        location ~ \.php$ {
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                include        fastcgi_params;
        }
}

P.S. Tried apache with same result.

Alex Russell

unread,
Jul 29, 2013, 10:20:37 AM7/29/13
to php...@googlegroups.com
For what it's worth (you probably got this running by now) this my first foray into Nginx and the setup was far from trivial.

First off I had no idea where to set this up (/var/www?) and under what user (local user? www-data?) but eventually just made it up. Looking at various Nginx-with-PHP tutorials, it appears to just do what you want and hope for the best. I'm not bitter.

Anyway, I ended up deciding to go with a subdir of /var/www so I could potentially have other sites in there if I wish, and I chowned everything to www-data (and when running the console/composer tasks I `sudo -u www-data`) and this is the config I ended up with (and it worked!):

server {
listen 80;

server_name ci.local;

root /var/www/phpci/;
index index.php;

try_files $uri /index.php;

location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}

It's pretty much what you have so I'm surprised yours didn't work - maybe it's the "/" prepended to "index.php" in the try_files rule.

Good luck!

Donald Gilbert

unread,
Aug 8, 2013, 10:22:49 AM8/8/13
to php...@googlegroups.com
Did you add the .htaccess when trying the Apache setup? It doesn't come included in the git checkout.

Howie Ross

unread,
Sep 20, 2013, 4:21:35 PM9/20/13
to php...@googlegroups.com
I'm having the same issue of  http://phpci.local redirects to http://phpci.local/session/login and 404's. I have an .htaccess with the  <IfModule mod_rewrite.c> block in it.

Any suggestions?

Howie Ross

unread,
Sep 23, 2013, 10:31:20 AM9/23/13
to php...@googlegroups.com
my htaccess file contains the following:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /working/phpci/public
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
</IfModule>

Roman Procopie

unread,
May 10, 2014, 6:51:18 AM5/10/14
to php...@googlegroups.com
If anyone is still interested, had the same issue. Just check that mod_rewrite is enabled
Reply all
Reply to author
Forward
0 new messages