内容发布更新时间 : 2025/1/11 14:29:35星期一 下面是文章的全部内容请认真阅读。
LAMP安装详细步骤(带安装包,suse 位环境通过)
########################
#组件;apache,php,mysql,gd2(画图),soap(OA认证需要).... ########################
下载安装包(sam在各官网原版下载) MainPath=/usr/local/soft mkdir ${MainPath} cd ${MainPath}
wget http://10.130.73.48/lamp.tar.gz tar -zxf lamp.tar.gz
一、安装mysql
通过凯莉系统安装(http://db.ied.com)
注意:编译php时使用的mysql路径是凯莉默认安装的路径,如果自行安装的mysql,要修改编译php对应的mysql路径。
二、安装apache
mkdir /usr/local/apache2
cd ${MainPath};tar -zxf httpd-2.2.21.tar.gz cd httpd-2.2.21/
./configure --prefix=/usr/local/apache2 --enable-module=so --enable-rewrite make
make install make clean
三、安装libxml2
mkdir -p /usr/local/modules/libxml
cd ${MainPath};tar -zxf libxml2-2.7.8.tar.gz cd libxml2-2.7.8/
./configure --prefix=/usr/local/modules/libxml make
make install make clean
cp /usr/local/modules/libxml/bin/xml2-config /usr/bin/xml2-config
四、安装zlib
mkdir /usr/local/modules/zlib
cd ${MainPath};tar -zxf zlib-1.2.5.tar.gz cd zlib-1.2.5/
./configure --prefix=/usr/local/modules/zlib make
make install make clean
五、安装jpeg
mkdir -p /usr/local/modules/jpeg mkdir -p /usr/local/modules/jpeg/bin mkdir -p /usr/local/modules/jpeg/lib mkdir -p /usr/local/modules/jpeg/include mkdir -p /usr/local/modules/jpeg/man mkdir -p /usr/local/modules/jpeg/man1
mkdir -p /usr/local/modules/jpeg/man/man1
cd ${MainPath};tar -zxf jpegsrc.v6b.tar.gz cd jpeg-6b/
./configure --prefix=/usr/local/modules/jpeg --enable-shared --enable-static
如果你的机器是64位,并且在安装gd时候出现下面错误:
/usr/bin/ld: /server/apache2/modlib/jpeg6//lib/libjpeg.a(compress.o): relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC /server/apache2/modlib/jpeg6//lib/libjpeg.a: could not read symbols: Bad value collect2: ld returned 1 exit status make[2]: *** [libgd.la] Error 1 修补办法(接上面步骤): vi Makefile
找到 CFLAGS= -O2 -I$(srcdir) 在后面加入-fPIC,即变成CFLAGS= -O2 -I$(srcdir) -fPIC(configure后改),然后继续: cp /usr/bin/libtool ./ make
make install-lib make install make clean
六、安装libpng
mkdir /usr/local/modules/libpng
cd ${MainPath};tar -zxf libpng-1.5.4.tar.gz cd libpng-1.5.4/
./configure --prefix=/usr/local/modules/libpng make
make install make clean
七、安装freetype
mkdir /usr/local/modules/freetype
cd ${MainPath};tar -zxf freetype-2.4.6.tar.gz cd freetype-2.4.6/
./configure --prefix=/usr/local/modules/freetype make
make install make clean
八、安装gd2
mkdir /usr/local/modules/gd2
cd ${MainPath};tar -zxf gd-2.0.35.tar.gz cd gd/2.0.35/
chmod 640 gd_png.c vi gd_png.c 将
#include "png.h"修改为
#include "/usr/local/modules/libpng/include/png.h"(注意是libpng路径)
./configure --prefix=/usr/local/modules/gd2 --with-zlib=/usr/local/modules/zlib/ --wit
h-png=/usr/local/modules/libpng/ --with-jpeg=/usr/local/modules/jpeg/ --with-xml2=/usr/local/modules/libxml/ --with-freetype=/usr/local/modules/freetype/ make
make install make clean
九、安装libmcrypt
mkdir /usr/local/modules/libmcrypt
cd ${MainPath};tar -zxf libmcrypt-2.5.7.tar.gz cd libmcrypt-2.5.7/
./configure --prefix=/usr/local/modules/libmcrypt make
make install make clean
十、安装mhash
mkdir /usr/local/modules/mhash
cd ${MainPath};tar -zxf mhash-0.9.9.9.tar.gz