Ubuntu Build Lnmp + Yii

Source: Internet
Author: User
Tags yii
Install MySQL

Apt-get Install Mysql-server mysql-client
The default installation is version 5.5, not the latest version
The process is simple and not much described.

Installing Nginx

Apt-get Install Nginx
Default Version 1.4.6
Unload script: Apt-get–purge remove Nginx

If you want to install the latest version you can do this:
1. Add Nginx apt Source to/etc/apt/sources.list
Copy
Deb Http://nginx.org/packages/ubuntu/trusty Nginx
DEB-SRC http://nginx.org/packages/ubuntu/trusty Nginx
Add to/etc/apt/sources.list file
The above configuration may be updated, the latest configuration can refer to: http://nginx.org/en/linux_packages.html#stable

2. Update Apt-key
wget Http://nginx.org/keys/nginx_signing.key
sudo apt-key add Nginx_signing.key
If you do not perform this step, a similar error occurs when you perform the following steps:
GPG error:http://nginx.org precise release:the following signatures couldn ' t be verified because the public key was not a Vailable:no_pubkey abf5bd827bd9bf62

3. Update apt
Apt-get Update

4. Re-install Nginx
Apt-get Install Nginx

5, after the installation of access to localhost, if there is nginx welcome page, the installation is successful.
sudo service nginx restart//restart

Installing PHP5

Apt-get Install PHP5-FPM
Apt-get Install php5-cgi php5-mysql php5-curl php5-gd php5-imagick php5-mcrypt
Php5-memcache php5-sqlite php5-xmlrpc Php5-json php5-common php5-dev Php5-redis

View PHP5 Running Processes
Ps-waux | grep php5
Open the close php5 process
sudo service php5-fpm stop
sudo service php5-fpm start
sudo service php5-fpm restart
sudo service php5-fpm status

Configuration

Vim/etc/nginx/conf.d/default.conf
1, specify the right root
Location/{
root/usr/share/nginx/html;
Index index.php index.html index.htm;
}
Location =/50x.html {
root/usr/share/nginx/html;
}
2. Open Support for PHP
# Pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
Location ~. php{
root/usr/share/nginx/html;
Fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php;
Fastcgi_param script_filenamedocument_root$fastcgi_script_name;
Include Fastcgi_params;
}

Vim/etc/php5/fpm/php.ini
Cgi.fix_pathinfo = 1 Remove the comment

Vim/etc/php5/fpm/pool.d/www.conf
; listen =/var/run/php5-fpm.sock
Listen = 127.0.0.1:9000

Configuration Complete!

Download Yii Framework Code

Http://www.yiichina.com/doc/guide/2.0/start-installation

'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
  • '). Text (i)); }; $numbering. FadeIn (1700); }); });

    The above describes the Ubuntu build Lnmp + Yii, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

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