Shatnerz
Shatnerz

Reputation: 2543

Configuring Phabricator and Nginx

So I am trying to install phabricator locally to play around with and see if it fits my needs. I've been following the installation and configuration documentation. I'm running Ubuntu 16.04 x64.

The output of the install script is

Package php5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package php5-cli is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  php7.0-cli:i386 php7.0-cli

Package php5-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package php5-mysql is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package php5-gd is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package php-apc is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'php5' has no installation candidate
E: Package 'php5-mysql' has no installation candidate
E: Package 'php5-gd' has no installation candidate
E: Package 'php5-dev' has no installation candidate
E: Unable to locate package php5-curl
E: Package 'php-apc' has no installation candidate
E: Package 'php5-cli' has no installation candidate
E: Unable to locate package php5-json
sudo: a2enmod: command not found
pcntl already installed
Cloning into 'libphutil'...
remote: Counting objects: 14639, done.
remote: Total 14639 (delta 0), reused 0 (delta 0), pack-reused 14639
Receiving objects: 100% (14639/14639), 7.91 MiB | 2.50 MiB/s, done.
Resolving deltas: 100% (8659/8659), done.
Checking connectivity... done.
Cloning into 'arcanist'...
remote: Counting objects: 17668, done.
remote: Total 17668 (delta 0), reused 0 (delta 0), pack-reused 17668
Receiving objects: 100% (17668/17668), 6.50 MiB | 1.27 MiB/s, done.
Resolving deltas: 100% (10897/10897), done.
Checking connectivity... done.
Cloning into 'phabricator'...
remote: Counting objects: 221159, done.
remote: Compressing objects: 100% (188/188), done.
remote: Total 221159 (delta 87), reused 0 (delta 0), pack-reused 220969
Receiving objects: 100% (221159/221159), 119.27 MiB | 5.39 MiB/s, done.
Resolving deltas: 100% (147990/147990), done.
Checking connectivity... done.


Install probably worked mostly correctly. Continue with the 'Configuration Guide':

    https://secure.phabricator.com/book/phabricator/article/configuration_guide/

You can delete any php5-* stuff that's left over in this directory if you want.

I have php7.0 and php-fpm7.0 installed.

nginx.conf

# Phabricator
server {
       listen 82;
       server_name localhost;
       root        /home/shatnerz/phabricator/phabricator/webroot/;

       location / {
                 index index.php;
                 rewrite ^/(.*)$ /index.php?__path__=/$1 last;
        }

        location /index.php {
                 fastcgi_pass   localhost:9000;
                 fastcgi_index   index.php;

                 #required if PHP was built with --enable-force-cgi-redirect
                 fastcgi_param  REDIRECT_STATUS    200;

                 #variables to make the $_SERVER populate in PHP
                 fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
                 fastcgi_param  QUERY_STRING       $query_string;
                 fastcgi_param  REQUEST_METHOD     $request_method;
                 fastcgi_param  CONTENT_TYPE       $content_type;
                 fastcgi_param  CONTENT_LENGTH     $content_length;

                 fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;

                 fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
                 fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;

                 fastcgi_param  REMOTE_ADDR        $remote_addr;
        }
}

and when I try to access http://localhost:82/ I get 502 Bad Gateway. My nginx/error.log shows

2017/01/25 09:15:16 [error] 13746#13746: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost:82"
2017/01/25 09:15:16 [error] 13746#13746: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost:82", referrer: "http://localhost:82/"

Upvotes: 2

Views: 1244

Answers (1)

Shatnerz
Shatnerz

Reputation: 2543

Looks like I had to edit /etc/php/7.0/fpm/pool.d/ and set

listen = /run/php/php7.0-fpm.sock

to

listen = 9000

Upvotes: 2

Related Questions