CentOS 6 – compile and install the LAMP environment, and YAF framework

Yesterday in the learning manual compile and install the LAMP environment, and YAF framework today ~
First to use yum LAMP built yesterday will be deleted
# sudo yum erase httpd php* mysql*
And then to be manually installed to compile it ~ I‘ll create a test folder in the usr, afraid after operation will not know where to go.
# mkdir /usr/test
# cd /usr/test
1.- Apache
# wget http://mirrors.cnnic.cn/apache//httpd/httpd-2.4.16.tar.bz2
This written description
Unzip and access
# tar -jxvf httpd-2.4.26.tar.bz2
# cd httpd-2.4.26
This written description
Installing GCC
# sudo yum install gcc
# ./configure –prefix=/test/httpd –enable-so –enable-rewrite
If Apr problem solution please click here
After you configure no problem
# make && make install
# sudo /usr/test/prefix/httpd -k start
If error:httpd:Couldnotreliablydeterminetheserver’sfullyqualifieddomainname,……. Just compile httpd folder solution is found, for example, I was:/usr/test/prefix/httpd, after entering the httpd.conf file found under the conf folder, editing, #ServerName www.example.con:80 remove the # in front, then restart.
So open up the address, It appears works! Installed Apache successfully compiled ~ PS If you want to delete the compressed file downloaded earlier can use filename command to remove Oh ~
# sudo yum install libxml2 libxml2-devel curl curl-devel libjpeg libjpeg-devel libpng libpng-devel libmcrypt libmcrypt-deel libtool-ltdl-devel
# wget http://cn2.php.net/get/php-5.5.28.tar.gz/from/this/mirror
# mv mirror php-5.5.28.tar.gz
# tar -zxvf php-5.5.28.tar.gz
# cd php-5.5.28
# ./configure –prefix=/usr/test/prefix/php –with-apxs2=/usr/test/prefix/httpd/bin/apxs –with-curl –with-mcrypt –enable-mbstring –with-iconv –with-gd –with-jpeg-dir=/ usr/test/local/lib –enable-pdo –with-pdo-mysql=mysqlnd –with-mysql=mysqlnd –with-mysqli=mysqlnd
# make && make install
And then have to wait slightly longer
When the compile is complete
# sudo cp php.ini-development /usr/test/prefix/php/lib/php.ini
# sudo ln -s /usr/test/prefix/php/bin/php /usr/bin/php
CP assignment ordered xiangjie LN ordered xiangjie
# sudo vi /usr/test/prefix/php/lib/php.ini
Leading semicolon include_path removed to include_path = /opt/php/lib/php leading semicolon include_path removed to include_path = /usr/test/prefix/PHP/lib/php
# sudo vi /usr/test/prefix/httpd/conf/httpd.conf
Add a new line at the bottom AddHandler application/x-httpd-php. php
# sudo /usr/test/prefix/httpd/bin/httpd -k restart
# sudo vi /usr/test/prefix/httpd/htdocs/phpinfo.php
Http://address/phpinfo.php can then see PHP configuration information on PHP mysqlnd PDO_MYSQL mysqli if packed ~ search shows PHP to access MySQL
Next, join the system Apache service, post launch
# sudo cp /usr/test/prefix/httpd/bin/apachectl /etc/init.d/httpd
# sudo vi etc/init.d/httpd
At the beginning of the file, add
#!:/ bin/sh
# chkconfig: 2345 85 15
# description: Apache is World Wide Web server
# sudo chmod +x /etc/init.d/httpd
# /sbin/chkconfig –add httpd
# sudo /sbin/chkconfig –list httpd
# sudo ln -s /sbin/chkconfig /usr/bin/chkconfig
# sudo ln -s /sbin/service /usr/bin/service
3-. MySQL MySQL directly using yum install tutorial to see an article built on LAMP environment
Install PHP extension 4.-SSH2 installed libssh2
# cd /usr/test/
# wget https://github.com/libssh2/libssh2/releases/download/libssh2-1.6.0/libssh2-1.6.0.tar.gz
#tar -zxvf libssh2-1.6.0.tar.gz
#cd libssh2-1.6.0
# ./configure –prifex=/usr/test/prefix/libssh2
# make && make install
Error says no cryoto library found. This is because I did not install the OpenSSLeep cryptographic libraries. So install it first
# yum install openssl-devel
Go back to the original folder to complete compilation
Then install ssh2
# cd /usr/test/
# wget http://pecl.php.net/get/ssh2-0.11.3.tgz
# tar -zxvf ssh2-0.11.3.tgz
# cd ssh2-0.11.3.tgz
# /usr/test/prefix/php/bin/phpize
# ./configure –prefix=/usr/test/prefix/ssh2 –with-ssh2=/usr/test/prefix/libssh2 –with-php-config=/usr/test/prefix/php/bin/php-config
# make && make install
Then in/usr/test/prefix/PHP/lib/php.ini add extension=SSH2.so
So the next step is Yaf friends ~
# cd /usr/test
# wget http://pecl.php.net/get/yaf-2.3.1.tgz
# tar -zxvf yaf-2.3.1.tgz
# cd yaf-2.3.1
# /usr/test/prefix/php/bin/phpize
# ./configure –prefix=/usr/test/prefix/yaf –with-php-confi=/usr/test/prefix/php/bin/php-config
# make && make install
Compile after installing required configured in the PHP.ini configuration
extendsion = yaf.so
yaf.environ = product
yaf.library = NULL
yaf.cache_config = 0
yaf.name_suffix = 1
yaf.name_separator = “”
yaf.forward_limit = 5
yaf.use_namespace = 0
yaf.use_spl_autoload = 0
And then restart the server to view phpinfo () yaf in extensions
Done ~ I can use the yaf framework to build your own Web site ~