Build a LNMP environment under Ubuntu. Compile and install mysql,nginx,php. Finally, install the composer under the Lnmp premise and install the Laravel frame. First, the third step begins to compile the installation PHP5.6.16
1. First enter " /usr/local/src folder, and then type
"sudo wget http://cn2.php.net/distributions/php-5.6.16.tar.gz" Enter and wait for the download to complete. After downloading, execute "sudo tar zxvf php-5.6.16.tar.gz" to unzip the file.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/77/A9/wKioL1Zq2sST2_RCAAEPHqVTHZ0919.png "style=" float: none; "title=" 1.png "alt=" Wkiol1zq2sst2_rcaaephqvthz0919.png "/>
2.
after extracting it into the PHP directory, "CD php-5.3.8" returns and executes "sudo./configure--prefix=/usr/local/server/php-- With-config-file-path=/usr/local/server/php--enable-mbstring--enable-ftp--WITH-GD--with-jpeg-dir=/ USR--WITH-PNG-DIR=/USR--with-mysql=mysqlnd--with-mysqli=mysqlnd--with-openssl-dir=/usr--with-openssl-- With-pdo-mysql=mysqlnd--with-pear--enable-sockets--with-freetype-dir=/usr--enable-gd-native-ttf-- WITH-ZLIB--WITH-LIBXML-DIR=/USR--with-xmlrpc--enable-zip--enable-fpm--enable-fpm--enable-xml--enable-sockets-- WITH-GD--with-zlib--with-iconv--enable-zip--with-freetype-dir=/usr/lib/--enable-soap--enable-pcntl--enable-cli ".
If the following error 1 occurs :
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/77/A9/wKioL1Zq2sWCOcU7AABcqm93o8Q612.png "style=" float: none; "title=" 2.png "alt=" Wkiol1zq2swcocu7aabcqm93o8q612.png "/>
description missing libxml2 library. The Libxml2-dev package needs to be installed . Execute command:sudo apt-get install Libxml2-dev
then proceed to step 2.
If error 2 also occurs :
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/77/AA/wKiom1Zq2sTitdF5AACxpIjz0nI246.png "style=" float: none; "title=" 3.png "alt=" Wkiom1zq2stitdf5aacxpijz0ni246.png "/>
description Missing libjpeg-dev Library. Execute command:sudo apt-get-y install Libjpeg-dev
then proceed to step 2.
If error 3 also occurs :
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/77/A9/wKioL1Zq2sbBksrcAACY2LZQKDs880.png "style=" float: none; "title=" 4.png "alt=" Wkiol1zq2sbbksrcaacy2lzqkds880.png "/>
description Missing libpng12-dev Library. Execute command:sudo apt-get install Libpng12-dev
If error 4 also occurs :
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/77/AA/wKiom1Zq2sWRVUqaAABOX_8CLf4883.png "style=" float: none; "title=" 5.png "alt=" Wkiom1zq2swrvuqaaabox_8clf4883.png "/>
description Missing libfreetype6-dev Library. Execute command:sudo apt-get-y install Libfreetype6-dev
then proceed to step 2.
execute "sudo./configure--prefix=/usr/local/server/php--with-config-file-path=/usr/local/server/ Php--enable-mbstring--enable-ftp--with-gd--with-jpeg-dir=/usr--with-png-dir=/usr--with-mysql=mysqlnd-- With-mysqli=mysqlnd--with-openssl-dir=/usr--with-openssl--with-pdo-mysql=mysqlnd--with-pear-- ENABLE-SOCKETS--WITH-FREETYPE-DIR=/USR--enable-gd-native-ttf--with-zlib--with-libxml-dir=/usr--with-xmlrpc-- Enable-zip--enable-fpm--enable-fpm--enable-xml--enable-sockets--with-gd--with-zlib--with-iconv-- enable-zip--with-freetype-dir=/usr/lib/--enable-soap--enable-pcntl--enable-cli".
The configuration succeeds if the following conditions occur.
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/77/AA/wKiom1Zq2sijIr2lAAIzeZhqIUM045.png "style=" float: none; "title=" 6.png "alt=" Wkiom1zq2sijir2laaizezhqium045.png "/>
3. Then execute the command "sudo make" followed by:sudomake install. Then wait for the installation to complete.
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/77/A9/wKioL1Zq2sug29cmAACO05kHVzs324.png "style=" float: none; "title=" 7.png "alt=" Wkiol1zq2sug29cmaaco05khvzs324.png "/>
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/77/AA/wKiom1Zq2svyrkQ8AACqsrenr6I198.png "style=" float: none; "title=" 8.png "alt=" Wkiom1zq2svyrkq8aacqsrenr6i198.png "/>
4. After the wait operation is complete, copy the startup script. Enter "sudo cp./SAPI/FPM/INIT.D.PHP-FPM/ETC/INIT.D/PHP-FPM" carriage return, then execute "sudo chmod+x/etc/init.d/php-fpm ".
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/77/AA/wKiom1Zq2syA-FD7AACWge5MquA561.png "style=" float: none; "title=" 9.png "alt=" Wkiom1zq2sya-fd7aacwge5mqua561.png "/>
5. Modify The php-fpm configuration file and execute "cd/usr/local/server/php/etc", "sudo cp php-fpm.conf.default" in turn Php-fpm.conf"," sudo mvphp-fpm.conf.default php-fpm.conf.default.bak ". As shown
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/77/AA/wKiom1Zq2s2jlCCIAADO3D2lpGQ049.png "style=" float: none; "title=" 10.png "alt=" Wkiom1zq2s2jlcciaado3d2lpgq049.png "/>
6. Sudo vimphp-fpm.conf Edit the configuration file.
① Remove the comment from line.
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/77/AA/wKioL1Zq2s-gd-EZAABqG41b7UE188.png "style=" float: none; "title=" 11.png "alt=" Wkiol1zq2s-gd-ezaabqg41b7ue188.png "/>
② confirm that the four items in the red box below are enabled, i.e. remove the comment.
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/77/AA/wKioL1Zq2tLhs9lPAAJGHuUZBVw925.png "style=" float: none; "title=" 12.png "alt=" Wkiol1zq2tlhs9lpaajghuuzbvw925.png "/>
Save and exit.
7.php-fpm start and exit using the command "Sudo/etc/init.d/php-fpmstart" and "sudo/etc/init.d/php-fpm stop" respectively.
If the following error occurs.
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/77/AA/wKiom1Zq2tLw5s-gAADCoG3UbUQ561.png "style=" float: none; "title=" 13.png "alt=" Wkiom1zq2tlw5s-gaadcog3ubuq561.png "/>
Workaround: Locate the following two items, modify to user = Edom Group = Edom, and change the user and group to their own users and groups.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/77/AA/wKiom1Zq2tKS0BTuAAArO31rFd8206.png "style=" float: none; "title=" 14.png "alt=" Wkiom1zq2tks0btuaaaro31rfd8206.png "/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/77/AA/wKiom1Zq2tLxrfTQAAAcpVN_3_4485.png "style=" float: none; "title=" 15.png "alt=" Wkiom1zq2tlxrftqaaacpvn_3_4485.png "/>
Restart PHP-FPM. is successful.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/77/AA/wKioL1Zq2tSiEwjoAAAr9vWC7Ww063.png "style=" float: none; "title=" 16.png "alt=" Wkiol1zq2tsiewjoaaar9vwc7ww063.png "/>
8. Prepare the PHP configuration file:
Go to php source file directory; cd/usr/local/src/php5.6.16
Execute command:
sudo cp-f Php.ini-production/usr/local/server/php/etc/php.ini
Grant permission: sudo chmod 644/usr/local/server/php/etc/php.ini
9. Execution command: php–v. If the query does not have PHP version information, execute the command: sudo cp/usr/local/server/php/bin/php/usr/bin/php
Then execute: php–v can be queried for version information.
From this, the php5.6.16 compilation installation is complete.
This article from the "Good Learning Day Up" blog, please be sure to keep this source http://sunrising.blog.51cto.com/10729461/1722198
Third, Ubuntu under the compiler installation PHP5.6.16