Skip to content

Instantly share code, notes, and snippets.

@thanhoangxuannghiep
Last active March 13, 2019 03:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thanhoangxuannghiep/3e10e756add3a906fbcc496670ce1c50 to your computer and use it in GitHub Desktop.
Save thanhoangxuannghiep/3e10e756add3a906fbcc496670ce1c50 to your computer and use it in GitHub Desktop.
PHP and Nginx on ubuntu

After created a topic talk about Install Nginx, PHP with homebrew on MacOS. I want to create small topic talk about PHP and Nginx on Ubuntu. I will show steps to install and configuration

1. Install Nginx

I'm sure that you can find many documents or topic talk about this. However, I want to create specific topic for myself. This is the way I remember any things after self-learing. Now, you can type following 2 commands

apt-get update && apt-get install -y nginx

Then, you can check status of your web server with command systemctl status nginx. If you see status is running, you can access the default Nginx landing page right now. Now, open your browser and enter localhost in your address bar. You are in default nginx landing page. On Ubuntu, nginx auto declares sub-folders for you, You don't need to run mkdir command as MacOS. In folder sites-available, you can see file default. You only need to edit this file to run your site. About configuration, You can refer the topic I have mentioned above.

2. Install PHP-FPM

Try to run following these commands:

apt-get -y update
add-apt-repository ppa:ondrej/php
apt-get -y update
apt-get install -y php7.0-fpm php7.0 php7.0-common php7.0-gd php7.0-mysql php7.0-mcrypt php7.0-curl php7.0-intl php7.0-xsl php7.0-mbstring php7.0-zip php7.0-bcmath php7.0-iconv php7.0-soap

Okay, You have installed successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment