php -v
PHP 5.6.3 (cli) (built: Oct 28 2015 09:47:41)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
But this only changes in CLI. You have to tweak you nginx(same for apache) to make it works. Nginx will still using the native PHP-FPM.
> ps aux | grep php-fpm
user 17093 0.7 2.5 512976 26080 ? Ss 13:40 0:00 php-fpm: master process (/etc/php-fpm.conf)
> phpbrew fpm start
To know which port our phpbrew fpm uses, we can check from ~/.phpbrew/php/php-5.6.3/etc/php-fpm.conf
...
; The address on which to accept FastCGI requests.
...
; Note: This value is mandatory.
listen = 127.0.0.1:9000
Ok it's 127.0.0.1:9000
. So in our nginx configuration, we do something like:
server {
...
location ~ \.php$ {
try_files $uri =404;
#fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; <--- probably default setting
fastcgi_pass 127.0.0.1:9000; <--- changed this
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
My system seems to be slightly different.
I looked in
~/.phpbrew/php/php-7.2.8/etc/php-fpm.d/www.conf
there I found
So I updated my config file to read.
Then I restarted nginx
and when I go to the page I get a
502 Bad Gateway
error. So I checked my log and saw the followingSo I checked my permissions and got the following any ideas?
I'm not sure what to try next.