Fast installation of LNMP environment in Ubuntu system

Source: Internet
Author: User
Tags fpm php and php redis redis install redis

has been using Ubuntu as a development environment, like tossing, desktop hanging, system play is often the case, here is recorded under Ubuntu using Apt-get Rapid build LNMP environment.
Install Mysql-server and Mysql-client
Apt-get Install Mysql-server mysql-client

Install Nginx
Apt-get Install Nginx

Nginx Related Operations Command

sudo service nginx start
sudo service nginx stop
sudo service nginx restart
sudo service Nginx Reload


Installing PHP and PHP-FPM and PHP extensions
sudo apt-get install PHP5-FPM
sudo apt-get install php5-cli
#安装相关扩展
sudo apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5 -ming php5-ps Php5-pspell php5-recode php5-sqlite php5-tidy php5-xmlrpc php5-xsl

PHP-FPM Operation Command
sudo service php5-fpm stop
sudo service php5-fpm start
sudo service php5-fpm restart
sudo service php5-fpm status

Install Redis-server and PHP Redis extensions:
sudo apt-get install Redis-server
sudo apt-get install Php5-redis

Finally, Nginx.conf adds a server (CodeIgniter framework for example)
Server {
    listen        80;
    server_name  www.test.com;
 
  root /var/www/html/
  index index.php index.html index.htm;
 
 & nbsp;  location/{
      try_files $uri $uri//index.php;
  }
&NBSP
  Location ~ \.php ($|/) {
  fastcgi_pass   unix:/var/run/php5-fpm.sock;
& nbsp; fastcgi_index  index.php;
  fastcgi_param  script_filename  $document _root$fastcgi_script_name;
  include        Fastcgi_params;
    }
 }

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.