V
V
Vadim Timoshenko2018-11-14 16:09:14
linux
Vadim Timoshenko, 2018-11-14 16:09:14

Nginx + PHP-FPM + MySQL on Ubuntu 18.04 how to choose PHP7?

Installed VDS with Ubuntu 18.04. I want to use Nginx + PHP-FPM + MySQL for the first time in my life.
I'm setting up Nginx. There is a line here:

#   Путь к сокету PHP-FPM
fastcgi_pass unix:/var/run/php5-fpm.sock;

I want to change to version 7. How to write the path correctly?
And as I understand it, ubuntu automatically has version 7?

Because when you try to install 7, this is what comes out:
sudo apt-get install php7-fpm php7-mysql php7-curl php7-gd php-mail -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7-fpm
E: Unable to locate package php7-mysql
E: Unable to locate package php7-curl
E: Unable to locate package php7-gd

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xtress, 2018-11-14
@PbI6A_KuT

a) since ubuntu 16, php 7 packages do not have postfix 7 - php-fpm should already install 7 (in your example, only the php-mail package name is correct);
b) how to set the path correctly ... depends on the fpm configs - after installing the puff, check under what name the socket will lie in the file system - `ls -la /var/run/php/*.sock` - then substitute it in the config .
c) (which should have been done a) - it's not worth puffing (although I don't remember exactly), install it yourself via `apt-get install php-fpm`

A
Anton Mashletov, 2018-11-14
@mashletov

sudo apt install php7.2-fpm php7.2-mysql php7.2-curl

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question