yum -y install wget make vim install gcc gcc-c++ ncurses ncurses-devel autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers pcre pcre-devel zlip zlip-devel libXpm*
3. php依赖库安装
libxml2 —— 包含库和实用工具用于解析XML文件
wget
tar zxvf libxml2-2.9.0.tar.gz
cd libxml2-2.9.0
./configure
make&&make install
libmcrypt —— 加密算法扩展库(支持DES, 3DES, RIJNDAEL, Twofish, IDEA, GOST, CAST-256, ARCFOUR, SERPENT, SAFER+等算法)
wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz
tar zxvf libmcrypt-2.5.7.tar.gz
cd libmcrypt-2.5.7
./configure
make && make install
默认的php安装后gd不支持jpg,只支持gif、png、bmp。所以首先要安装gd库
wget
tar zxvf libgd-2.1.0.tar.gz
cd libgd-2.1.0
./configure --prefix=/usr/local/webserver/gd2/
make && make install
4. MySQL配置安装
安装
cd /usr/local
mkdir webserver
cd /usr/local/src
tar zxvf mysql-5.6.14-linux-glibc2.5-i686.tar.gz -C /usr/local/webserver
cd /usr/local/webserver
mv mysql-5.6.14-linux-glibc2.5-i686 mysql
配置
groupadd mysql
useradd -r -g mysql mysql
cd mysql
chown -R mysql .
chgrp -R mysql.
scripts/mysql_install_db --user=mysql
chown -R root .
chown -R mysql data/
cp support-files/my-default.cnf /etc/my.cnf
bin/mysqld_safe --user=mysql &
配置启动mysql脚本
vim support-files/mysql.server
#将
#basedir=
#datadir=
#改为
#basedir=/usr/local/webserver/mysql
#datadir=/usr/local/webserver/mysql/data
cp support-files/mysql.server /etc/init.d/mysql
启动/停止mysql
#将mysql/bin目录加入系统环境变量中
service mysql start
service mysql stop
service mysql restart
相关阅读:
Ubuntu 13.04 安装 LAMP\Vsftpd\Webmin\phpMyAdmin 服务及设置
生产环境实用之LNMP架构的编译安装+SSL加密实现
CentOS 6.3 安装LNMP (PHP 5.4,MyySQL5.6)
Ubuntu安装Nginx php5-fpm MySQL(LNMP环境搭建)