Lamp Environment Compilation
Preparatory work
Disabling SELinux and firewall iptables-f
A simple shell decompression script
[Email protected] xiaoming]# VI tar.sh
#!/bin/sh
Cd/root
LS *.tar.gz > Ls.list
For TAR in ' Cat ls.list '
Do
TAR-ZXF $TAR
Done
1. Unpack the package. tar.gz TAR-ZVXF
2./configure Configuration
3. Make compile
4. Make install, copy
1) libxml2
# CD libxml2-2.6.30
#./configure--prefix=/usr/local/libxml2/
Make && make install
2) Libmcrypt
# CD libmcrypt-2.5.8
#./configure--prefix=/usr/local/libmcrypt/
Make && make install
# CD libltdl/
#./configure--enable-ltdl-install
Make && make install
3) zlib
# CD zlib-1.2.3
#./configure (do not specify the installation path to prevent other software from locating the location)
Make && make install
(Installation information can be located in a file make install >/backup/zlib_20151121.install.log)
4) libpng
# CD libpng-1.2.31
#./configure--prefix=/usr/local/libpng/
Make && make install
5) Jpeg6
# CD jpeg-6b/
# Mkdir/usr/local/jpeg6
# Mkdir/usr/local/jpeg6/bin
# Mkdir/usr/local/jpeg6/lib
# Mkdir/usr/local/jpeg6/include
# mkdir-p/usr/local/jpeg6/man/man1
#./configure--prefix=/usr/local/jpeg6/--enable-shared--enable-static
Make && make install
6) FreeType
# CD: /freetype-2.3.5
#./configure--prefix=/usr/local/freetype
Make && make install
7) autoconf
# CD: /autoconf-2.61
#./configure; make; Make install (preferably without specifying the installation path)
8) GD
# CD: /gd-2.0.35
#./configure--prefix=/usr/local/gd2/--with-jpeg=/usr/local/jpeg6--with-freetype=/usr/local/freetype/(no zlib, Let it find it automatically)
Make && make install
9) Apache
# CD: /httpd-2.2.9
#./configure--prefix=/usr/local/apache2/--sysconfdir=/etc/httpd/--with-included-apr--disable-userdir-- Enable-so--enable-deflate=shared--enable-expires=shared--enable-rewrite=shared--enable-static-support
Make && make install
#/usr/local/apache2/bin/apachectl Start service to test whether Apache is working
MySQL)
A compilation tool needs to be installed first
# CD: /ncurses-5.6
#./configure--with-shared--without-debug--without-ada--enable-overwrite
Make && make install
# Groupadd MySQL
[[email protected] ncurses-5.6]# grep mysql/etc/group
mysql:x:8890:
# useradd-g MySQL MySQL
[[email protected] ncurses-5.6]# grep mysql/etc/passwd
Mysql:x:1008:8890::/home/mysql:/bin/bash
# CD: /mysql-5.0.41
#./configure--prefix=/usr/local/mysql/--with-extra-charsets=all
Make && make install
# CP SUPPORT-FILES/MY-MEDIUM.CNF/ETC/MY.CNF
#/usr/local/mysql/bin/mysql_install_db--user=mysql
# Chown-r Root/usr/local/mysql
# Chown-r Mysql/usr/local/mysql/var
# Chgrp-r Mysql/usr/local/mysql
#/usr/local/mysql/bin/mysqld_safe--user=mysql &
#/usr/local/mysql/bin/mysql-u Root
mysql> SET PASSWORD for ' root ' @ ' localhost ' =password (' root ');
Let Apache boot automatically
# echo "/usr/local/apache2/bin/apachectl start" >>/etc/rc.d/rc.local
MySQL startup script
# CP Support-files/mysql.server/etc/rc.d/init.d/mysqld
# chown Root.root/etc/rc.d/init.d/mysqld
# chmod 755/etc/rc.d/init.d/mysqld
# chkconfig--add mysqld
# chkconfig--list mysqld
Mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
# chkconfig--levels 245 mysqld off
# chkconfig--list mysqld
Mysqld 0:off 1:off 2:off 3:on 4:off 5:off 6:off
PHP)
# CD: /php-5.2.6
#./configure--prefix=/usr/local/php/--with-config-file-path=/usr/local/php/etc/
--with-apxs2=/usr/local/apache2/bin/apxs--with-mysql=/usr/local/mysql/
--with-libxml-dir=/usr/local/libxml2/--with-jpeg-dir=/usr/local/jpeg6/
--with-freetype-dir=/usr/local/freetype/--with-gd=/usr/local/gd2/
--with-mcrypt=/usr/local/libmcrypt/--with-mysqli=/usr/local/mysql/bin/mysql_config
--enable-soap--enable-mbstring=all-enable-sockets
Make && make install
# CP Php.ini-dist/usr/local/php/etc/php.ini
# vi/etc/httpd/httpd.conf
AddType application/x-httpd-php. php. phtml
#/usr/local/apache2/bin/apachectl Restart
# vi/usr/local/apache2/htdocs/info.php
<?php
Phpinfo ();
?>
) Zend Accelerator
# CD Zendoptimizer-3.2.6-linux-glibc21-i386
#./install.sh
Enter the PHP.ini profile address
/usr/local/php/etc
phpMyAdmin)
# cp-a. /phpmyadmin-3.0.0-rc1-all-languages/usr/local/apache2/htdocs/phpmyadmin
# cd/usr/local/apache2/htdocs/phpmyadmin/
# CP config.sample.inc.php config.inc.php
# VI config.inc.php
$cfg [' Servers '] [$i] [' auth_type '] = ' http ';
14) Install Curl expansion
# CD curl-7.19.6
#./configure--prefix=/usr/local/curl
Make && make install
# CD Php-5.2.6/ext/curl (into the ext directory in the PHP source program directory)
#/usr/local/php/bin/phpize (call Phpize program to generate compilation configuration file)
#./configure--with-php-config=/usr/local/php/bin/php-config--with-curl=/usr/local/dir
Error occurred:
Configure:error:Please Reinstall the Libcurl distribution-easy.h should be in <curl-dir>/include/curl/
In fact, Curl's dev pack is not installed, the solution:
# yum-y Install Curl-devel
Make && make install
# Mkdir/usr/local/php/ext
# cp/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/curl.so/usr/local/php/ext/
Modify PHP Extension Library directory
# Vi/usr/local/php/etc/php.ini
Extension_dir = "/usr/local/php/ext/"
Extension=curl.so
#/usr/local/php/bin/php-v when executing a command, PHP will detect if the configuration file is correct
Restart Apache
#/usr/local/apache2/bin/apachectl Restart
Detecting modules that have been loaded by PHP
#/usr/local/php/bin/php-m | grep Curl
Lamp Environment Compilation