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;
}
}