lamp_memcache_pdo

#php中解决xml文件的程序
tar -zxvf libxml2-2.6.30.tar.gz
cd libxml2-2.6.30
./configure --prefix=/usr/local/libxml2/
make && make install
 
 
#libmcrypt是加密算法扩展库。支持DES,
tar -zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure --prefix=/usr/local/libmcrypt/
make && make install


#工具包
cd libltdl
./configure --enable-ltdl-install
make && make install



#压缩算法的工具函数
tar -zxvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure
make && make install

#处理png图片的类库
tar -zxvf libpng-1.2.31.tar.gz
cd libpng-1.2.31
./configure --prefix=/usr/local/libpng/
make && make install


#支持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

tar -zxvf jpegsrc.v6b.tar.gz

cd jpeg-6b
./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
make && make install

#访问字体文件格式
tar -zxvf freetype-2.3.5.tar.gz
cd freetype-2.3.5
./configure --prefix=/usr/local/freetype/
make && make install



#自动配置软件源代码程序
tar -zxvf autoconf-2.61.tar.gz
cd autoconf-2.61
./configure
make  && make install

#图片支持库 验证码
tar -zxvf gd-2.0.35.tar.gz
cd gd-2.0.35

./configure --prefix=/usr/local/gd2/ --with-jpeg=/usr/local/jpeg6/ --with-freetype=/usr/local/freetype/
make && make install



#web 服务器
tar -zxvf httpd-2.2.9.tar.gz
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.sysinit



#mysql 依据类库
tar -zxvf ncurses-5.6.tar.gz
cd ncurses-5.6
./configure --with-shared --without-debug --without-ada --enable-overwrite
make && make install


#

groupadd mysql
useradd -g mysql mysql

tar -zxvf mysql-5.1.58.tar.gz

cd mysql-5.1.58
./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 &

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
#chkconfig --levels 245 mysqld off


 

tar -zxvf php-5.2.6.tar.gz
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/           \
--enable-soap                                   \
--enable-mbstring=all                          \
--enable-sockets                               \          
make && make install



cp php.ini-dist /usr/local/php/etc/php.ini
#用vi修改
echo "Addtype application/x-httpd-php .php .phtml" >> /etc/httpd/httpd.conf
/usr/local/apache2/bin/apachectl restart





//-------------------------------------------------------
chmod 755 /usr/local/apache2//modules/libphp5.so
chmod: cannot access `/usr/local/apache2//modules/libphp5.so': No such file or di
apxs:Error: Command failed with rc=65536
.
make: *** [install-sapi] Error 1
//--------------------------------------------------------
解决::
cp /usr/local/apache2/build/libtool /root/php-5.2.6/

[root@james php-5.2.6]# make clean
[root@james php-5.2.6]# make && make install

################################################
问题!
/root/php-5.2.6/sapi/cli/php: error while loading shared libraries: libltdl.so.3: cannot open shared object file: No such file or directory


yum install libtool-libs
yum install libtool-ltdl-devel
##################################################



将mysql 修改系统服务
#cd /usr/local/mysql/   
#cp support-files/mysql.server /etc/init.d/mysql   
#chmod 777 /etc/init.d/mysql    
#chkconfig --add mysql   
#chkconfig --level 35 mysql on  
#service mysql restart

设定环境变量

[root@localhost mysql]# vi /etc/profile


export PATH=/usr/local/mysql/bin:$PATH


//####################################################################
#安装Zend加速器 优化编译后的php程序性能官方 40%-100%
#安装图形界面
#安装不用make make install
#指定apache目录  指定 php.ini 目录 /usr/local/php/etc
#安装成功后 运行phpinfo
#显示如下正确认息:Zend Optimizer v3.2.6, Copyright (c) 1998-2007, by Zend Technologies
tar -zxvf ZendOptimizer-3.2.6-linux-glibc21-i386.tar.gz
cd ZendOptimizer-3.2.6-linux-glibc21-i386
./install.sh

#------------------------------------------------------------------
#安装PDO
tar -zxvf PDO_MYSQL-1.0.2.tgz
#注意一定要在PDO目录下不然后报错
#Cannot find config.m4.
[root@james PDO_MYSQL-1.0.2]# /usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql/
make && make install
#运行后记住php扩展目录
Installing shared extensions:     /usr/local/php//lib/php/extensions/no-debug-non-zts-20060613/
#手工修改php.ini 目录
vi /usr/local/php/etc/php.ini
#添加扩展目录
extension = "pdo_mysql.so"
测试重启动apache
/usr/local/apache2/bin/apachectl restart
phpinfo();

//-------------------------------------------------------------------
#安装memcached
#memcached 依赖于libevent 先安装
tar -zxvf libevent-1.3.tar.gz
cd libevent-1.3
./configure --prefix=/usr/libevent
make && make install
#测试是否安装成功
ls -al /usr/lib | grep libevent
#安装memcached
tar -zxvf memcached-1.4.1.tar.gz
cd memcached-1.4.1
./configure -with-libevent=/usr/libevent
make && make install
#测试是否安装成功
ls -al /usr/local/bin/me*
#启动memcached
/usr/local/bin/memcached -d -m 128 -u root


##错误
/usr/local/bin/memcached: error while loading shared libraries: libevent-1.3.so.1: cannot open shared object file: No such file or directory

#解决 创建软链接
ln /usr/libevent/lib/libevent-1.3.so.1.0.3 /usr/lib/libevent-1.3.so.1

#测试
netstat -alut

#安装
tar -zxvf memcache-2.2.5.tgz
cd memcache-2.2.5
#注意目录
[root@james memcache-2.2.5]# /usr/local/php/bin/phpize
./configure --prefix=/usr/local/memcache  --with-php-config=/usr/local/php/bin/php-config
make && make install
#
#
#手工修改php.ini 目录
vi /usr/local/php/etc/php.ini
#添加扩展目录
extension = "memcache.so"
#重新启动apache
/usr/local/apache2/bin/apachectl restart

 

出自:http://www.cnblogs.com/kaka100/archive/2013/01/11/2856305.html

你可能感兴趣的:(PHP,lamp)