LAMP 环境编译
1.php安装前的环境部署
(1).libxml2安装: #这里libxml2是库文件
cd libxml2-2.6.30/
./configure --prefix=/usr/local/libxml2/
make && make install
(2).libmcrypt-2.5.8安装: #这里libmcrypt是库文件
cd libmcrypt-2.5.8/
./configure --prefix=/usr/local/libmcrypt/
make && make install
(3).libltdl安装: #这里libltdl在libmcrypt-2.5.8中是库文件
cd libmcrypt-2.5.8/libltdl/
./configure --enable-ltdl-install
make && make install
(4).zlib-1.2.3安装: #这里zlib-1.2.3库文件
./configure #推荐安装不指定安装路径
make && make install
(5).libpng-1.2.31安装: #png图片库文件
./configure --prefix=/usr/local/libpng/
make && make install
(6).jpeg-6b安装: #jpeg图片库文件
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
(7).freetype-2.3.5的安装: #freetype字体库文件
cd freetype-2.3.5/
./configure --prefix=/usr/local/freetype/
make && make install
(8).autoconf-2.61的安装:
cd autoconf-2.61/ #推荐安装不指定安装路径
./configure ; make ;make install
(9).gd-2.0.35的安装:
cd gd-2.0.35/
./configure --prefix=/usr/local/gd --with-jpeg=/usr/local/jpeg6 --with-freetype=/usr/local/freetype/
make && make install
2.开始安装服务:
(1).httpd-2.2.9安装:
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
echo "/usr/local/apache2/bin/apachectl start" >>/etc/rc.d/rc.local #设置开机启动
(2).mysql-5.0.41安装:
首先安装ncurses-5.6编译工具:
cd ncurses-5.6/
./configure --with-shared --without-debug --without-ada --enable-overwrite
make && make install
再安装.mysql-5.0.41:
groupadd mysql
useradd -g mysql mysql
cd mysql-5.0.41/ #支持所有字符集
./configure --prefix=/usr/local/mysql --with-extra-charset=all
make && make install
cp support-files/my-medium.cnf.sh /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 & #启动mysql
/usr/local/mysql/bin/mysql -u root
mysql>SET PASSWORD FOR 'root'@'localhost'=PASSWORD('Linux gu ying') #给mysql 设置密码
cp mysql-5.0.41/support-files/mysql.server.sh /etc/init.d/mysqld #创建mysql启动脚本
chown root.root /etc/init.d/mysqld
chmod 755 /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig --levels 245 off
(3)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-5.2.6/php.ini-dist /usr/local/php/etc/php.ini
设置apace支持php
vim /usr/local/apche2/conf/httpd.conf
Addtype application/x-httpd-php .php .phtml
测试apache是否支持php
echo <? phpinfo(); ?> >/usr/local/apache2/htdocs/phpinfo.php
/usr/local/apache2/bin/apachectl restart
firefox 127.0.0.1/phpinfo.php #能看到php的version信息就代表解析成功!
################################# L A M P is succefully ##################################################################
3.小工具的安装
(1)zend加速器的安装:
cd ZendOptimizer-3.2.6-linux-glibc21-i386/
./install
zend 安装存放路径 /usr/local/zend
php 存放路径 /usr/loca/php/etc/
apcche 存放路径 /usr/local/apache2/bin/apachectl
(2)phpMadmin的安装:
cp -r 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
更改认证
$cfg['Servers'][$i]['auth_type'] = 'cookie';
更改为$cfg['Servers'][$i]['auth_type'] = 'http';
firefox 127.0.0.1/phpmyadmin/index.php