Home > Backend Development > PHP Tutorial > ubuntu builds LNMP + Yii

ubuntu builds LNMP + Yii

WBOY
Release: 2016-07-29 08:57:38
Original
981 people have browsed it

Install Mysql

apt-get install mysql-server mysql-client
The default version installed is version 5.5, which is not the latest version
The process is relatively simple and not much described.

Install Nginx

apt-get install nginx
Default version 1.4.6
Uninstall 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. For the latest configuration, please 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, an error similar to this will appear when performing the following steps:
GPG error: http://nginx.org precise Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY ABF5BD827BD9BF62

3. Update apt
apt-get update

4. Reinstall nginx
apt-get install nginx

5. After installation, visit localhost. If there is a welcome page for nginx, it means the installation is successful.
sudo service nginx restart // Restart

Install 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 the php5 running process
ps -waux | grep php5
Open and close the 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 correct root
location / {
root /usr/share/nginx/html;
index index.php index.html index.htm;
}
location = /50x.html {
root /usr/share/nginx/html;
}
2. Enable 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_FILENAME
document_root$fastcgi_script_name;
include fastcgi_params;
}

vim /etc/php5/fpm/php.ini
cgi.fix_pathinfo = 1 Remove the comments

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

Configuration completed!

Download the 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 ').text(i)); }; $numbering.fadeIn(1700); }); });

The above introduces how to build LNMP + Yii on ubuntu, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template