0

I need to create the environment for my PHP code (Laravel) with latest nginx and latest PHP. The script should be optionally the single file able to update the PHP version or Nginx version if these are old.

Let me show you what I found: https://github.com/laravel/settler/blob/master/scripts/provision.sh

But in there you are specifically set to a version php7.1

Excerpt...
service php7.1-fpm restart

I know that Nginx configuration should mention the version of PHP used, so if the latest PHP is 7.1 or tomorrow 7.2 is it possible for this script to adopt.

What I liked in this script is:

apt-add-repository ppa:nginx/development -y
apt-add-repository ppa:ondrej/php -y

So just based on that you can always tell what is the latest version on Nginx and latest version of PHP in these repos.

My target platform is Ubuntu 16.04 LTS

prosti
  • 348
  • 1
  • 6
  • 18
  • Why would nginx need information on PHP version? – Tero Kilkanen Mar 24 '17 at 19:53
  • Good question, @TeroKilkanen I if I recall the Nginx configuration files for specific site may contain `fastcgi_pass` either via port 127.0.0.1:9000 or via socket `fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;` So I generally use sockets and this reveals the php version strange. – prosti Mar 25 '17 at 11:02
  • 1
    That is only the location of the Unix socket, and that can be configured in PHP. You only need to make sure they are the same in both nginx and PHP. – Tero Kilkanen Mar 25 '17 at 15:18

0 Answers0