Hi, I was testing nginx with dynamic modules from https://launchpad.net/~hda-me/+archive/ubuntu/nginx-stable but I could not get php7.1-fmp wordking. Nginx works, modules works but not php. I am not to knowledgeable is server management. I followed this tutorial except for nginx that I installed from ppa and mariadb instead of mysql: https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-in-ubuntu-16-04 Something is missing but I don’t know what?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Click below to sign up and get $200 of credit to try our products over 60 days!
Generally this section:
… would look something like:
The difference being we’re swapping
Not all NGINX repositories have a
snippetsdirectory that contains blocks of code. Even if they do, not all of them contain everything that’s needed (at least, that has been my experience).
If you don’t mind trying something different, and you have a few extra minutes, I wrote and installer for NGINX that handles a source installation hands-free.
It includes HTTP2, Brotli, a few modules, and multiple example configurations with it.
If you run:
You’ll have a fully configured and optimized NGINX setup with a working PHP configuration that you can copy from the
Within this directory there’s a
phpdirectory which contains a
php.conffile. That’s the one you need and to set it up, all you’d do is:
… and configure it to your liking. There’s also examples on how to setup SSL, Load Balancing, Proxy, and others.
The installer will take about 20-30 minutes as this is a source compile, not a stock repo package. It’s detailed and sets up everything you’d have to do a source compile to setup. A
systemdservice is also included, so NGINX is controlled using:
The only thing I’d recommend doing is:
1). Run the installer on a fresh Ubuntu 16.04 droplet, or; 2). Run:
This wipes your current NGINX installation, so if you need to backup anything, do it before the above commands. That said, the installer has all the examples you need to get things working and I will be more than happy to help should you have any questions.
As for the
examplesdirectory, most are setup so that you only need to change the
server_namedirective. The only other thing you may need to modify is the
fastcgi_passdirective since you’re using sockets instead of TCP, or you can modify:
php-fpmand the example I provided will work without any changes other than those for your domain.
If you installed NGINX and then used the auto-installer that I posted without removing the previous install, it’s most likely attempting to use the version that you installed from the OS repositories.
You should be able to run
apt-get remove nginxto remove the repository version that was installed. That shouldn’t remove anything that the auto-installer created, though I’d still recommend backing up the
Something such as:
That way if something doesn’t work, you can copy the files back in to place from the backup directory.
@jtittle From my google search I need to purge and reinstall nginx. Do you see any other options?