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
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.
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.