linux9.0+php4.33+GD2.0.15安装笔记
时间:2006-03-13 来源:cnscn2008
首先感谢这里所有人对我的支持,特别感谢那些帮助我的人,叩首!
安装环境:linux9.0,在配置防火墙的时候要打开ssh/www
以下是我在安装的时候所用的软件清单:
php-4.3.3.tar.bz
gd-2.0.15.tar.gz
jpeg-v6b.tar.gz
libpng-1.2.5.tar.gz
zlib-1.1.4.tar.gz
freetype-2.1.5.tar.bz2
httpd-2.0.47.tar.gz
php-4.3.3.tar.gz
1、安装jpeg-6b
#./configure
#make
编译成功,但是在安装的时候报错,系统提示不能将文件拷贝到/usr/local/man/man1这个目录,于是建立目录以后安装成功:
#mkdir /usr/local/man & /usr/local/man/man1
安装记录
# make install
# make install-lib //以前因为没有执行这一步安装导致在编译php时报错
2、libpng-1.2.5的安装配置
#cp scripts/makefile.gcmmx makefile \\makefile.gcmmx是针对MMX指令集优化的
#make && make install
3、zlib-1.1.4安装配置
#./configure --shared \\shared生成zlib的共享库文件
#make && make install
4、freetype-2.1.5安装配置
#./configure
#make && make install
5.gd-1.0.15安装配置
#./configure
配置完成后,注意输出的信息是否如下:
** Configuration summary for gd 2.0.15:
Support for PNG library: yes
Support for JPEG library: yes
Support for Freetype 2.x library: yes
Support for Xpm library: no
Xpm库以前安装不成功,如果程序部门不常用用,一般PNG/JPEG/FREETYPE三个库打开支持就行
#make && make install
#cp gd.h /usr/local/lib \\编译PHP的时候会缺少这个文件出错
6、apache2.0.47安装配置
#./configure --prefix=/www/httpd --enable-so
#make && make install
\\安装成功
7、php-4.3.3安装配置
# ./configure --prefix=/www/httpd/php --with-apxs2=/www/httpd/bin/apxs --enable-track-vars --with-zlib-dir=/usr/local/lib
--with-gd=/usr/local/lib --enable-sysvmsg --enable-sockets --enable-sysvshm --enable-sysvsem
--enable-gd-native-ttf --with-ttf=/usr/lib --disable-debug --with-tiff-dir=/usr/lib
--with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/local/lib --with-mysql --with-xml --with-gdbm-dir=/usr/lib
--enable-ftp --enable-inline-optimization --with-gettext=/usr/lib --enable-magic-quotes --enable-safe-mode
--enable-bcmath --enable-wddx --with-freetype-dir=/usr/local/lib
#make && make install
\\要把php.ini文件cp到你安装php目录下的lib下面,不然对php.ini的配置不会生效
\\安装成功
再次叩头感谢
借鉴的参考文献
http://chinaunix.net/jh/13/161118.html
http://www.chinaunix.net/jh/13/195204.html
http://www.neweasier.com/article/20...1039947379.html
【发表回复】【查看论坛原帖】【添加到收藏夹】【关闭】
--------------------------------------------------------------------------------
unigium 回复于:2004-01-16 13:01:46
只所以可以安装成功,就是要有耐性,你所想的其实大部分前辈们已经有写好的帖子在这里,我们要认真的找,然后根据自己的情况组合起来^-^
真开心
--------------------------------------------------------------------------------
好好先生 回复于:2004-01-16 13:28:42
祝贺你!
--------------------------------------------------------------------------------
unigium 回复于:2004-01-16 13:52:30
谢谢你的帮助,兄弟!
--------------------------------------------------------------------------------
small-bird 回复于:2004-01-30 14:40:18
http://bbs.chinaunix.net/forum/viewtopic.php?t=244551
存在这个问题吗?
linux下安装最新apache2.0.52+php5+gd2+mysql 由 于gd2才开始支持真彩图片的创建,所以,,升级服务器,因为原来的安装都是默认的系统安装,也更因为是个菜鸟,所以,安装很困难,起初根据网上一些文章 在我的red hat A 3 上安装测试,不过,测试了安装php4.3.X 和php5.0.X都没有成功,最后,根据其他人的文章,自己搞了将近3天,终于安装上了,下面就我安装中出现的错误和过程写出来和大家分享,以免有像我 一样的菜鸟们走弯路! (我可是两天多的时间,安装php的次数不下50次得来的经验,希望大家多多支持,有错误当然欢迎给我指正!转载请注明来自中国智慧在线(http: //article.21e.cn ,谢谢!),以下经过测试在red hat 9 和red hat A 3上通过!
欢迎转载,但是请注明原出处:http://article.21e.cn !!谢谢!
如果你机器里原来装有了PHP或者APACHE的RPM或者低版本.你可以现删除,删除安装简洁一些,不过我的实际操作过程是煤油删除,而直接安装的.当然你也可以跟我一样!
首先,服务器GCC要有,不然什么都不能做.可以用gcc -v来查看是否安装了GCC,
#gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
Thread model: posix
gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-34)
有以上类似信息说明已有GCC,
没有就现安装吧,至于如何安装,我就不说了,可以用光盘安装或者是下载源文件都可以,当然你的版本不一定是3.2.3!
请下载以下所有的东西:
httpd-2.0.X.tar.gz 版本最好是下载最新的啦,下载地址:http://www.apache.org
MySQL-client-4.0.20-0.i386.rpm
MySQL-server-4.0.20-0.i386.rpm(如果你打算升级mysql的话请下载,下载地址:http: //www.mysql.org 当然也是下载最新的版本最好了,由于我不打算安装mysql,就省略了,安装的时候的步骤也是先安装mysql!)
php-5.0.X.tar.gz 下载地址:http://www.php.net
ZendOptimizer-2.5.3-linux-glibc21-i386.tar.gz
zend的最新版安装是好像有点问题,就下载这个版本就可以,zend用来加速php,你可以选择不安装!下载地址:http: //www.zend.com
gd-2.0.28.tar.gz 这个软件的下载地址,php推荐的是:http://www.boutell.com/gd/ 但是由于某些原因,开发者不支持gif图像的创建,这有点不太方便,所以,我下载了个支持gif图像的,也就是打了gif补丁的:http: //www.rime.com.au/gd/
libxml2-2.X.X.tar.gz 下载地址:
zlib-1.X.X.tar.gz 忘记了,自己找一下吧
jpegsrc.v6b.tar.gz 下载地址:ftp://ftp.uu.net/graphics/jpeg/
libpng-1.2.5.tar.gz 下载地址:http://www.libpng.org/pub/png/libpng.html
freetype2-X.X.tar.gz 下载地址:http://www.fretype.org
xpm-3.4k-2.i386.rpm 忘记了,自己找一下吧
以上都是我下载的官方地址,软件的版本中的X,你自己看看你想用哪个版,不过最好是用最新稳定版本的!如果你以前安装过上述软件的其他版本,你也可以选择不安装!
安装MYSQL 服务器:
#rpm -ivh MySQL-server-4.0.20-0.i386.rpm
#rpm -ivh MySQL-client-4.0.20-0.i386.rpm
安装好后试试能不能用
#mysql 如果设置了密码后测试方法是(mysql -u root -proot -h localhost 注意的是-p后煤没有空格,直接跟密码)
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 27651 to server version: 4.0.20-standard
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
说明可以了!
请自己改mysql的密码,方法不说了!
安装XPM
#rpm -ivhxpm-3.4k-2.i386.rpm
安装libxml
# tar -zxf libxml2-2.6.16.tar.gz
# cd libxml2-2.6.16
# ./configure (xml默认安装就可以,不要指定路径了,因为安装时php可能找不到它,PHP5只支持libxml2-2.5.10以上版本)
# make
# make install
安装zlib
# tar -zxf zlib-1.2.2.tar.gz
# cd zlib-1.2
# ./configure --prefix=/usr/local/zlib2 (注意,如果您以前没有安装zlib,可以不指定路径,我是没有删除以前的低版本才指定的!以下雷同!)
# make
# make install
安装jpeg
# tar -zxf jpegsrc.v6b.tar.gz
# cd jpeg-6b/
# ./configure --prefix=/usr/local/jpeg6
# make
# make install-lib
如果你选择默认安装,可能很顺利,指定路径后,请先创建以下文件夹
错误提示:...... /usr/bin/install -c -m 644 jconfig.h /usr/local/jpeg6/include/jconfig.h
/usr/bin/install: 无法创建一般文件‘/usr/local/jpeg6/include/jconfig.h’: 没有那个文件或目录
make: *** [install-headers] Error 1
# mkdir /usr/local/jpeg6
# mkdir /usr/local/jpeg6/include
# mkdir /usr/local/jpeg6/lib
# make install-lib
# make install
安装时如果错误提示:
/usr/bin/install: 无法创建一般文件‘/usr/local/jpeg6/lib/libjpeg.a’: 没有那个文件或目录
make: *** [install-lib] Error 1
创建如下文件夹:
# mkdir /usr/local/jpeg6/lib
# make install
/usr/bin/install -c cjpeg /usr/local/jpeg6/bin/cjpeg
/usr/bin/install: 无法创建一般文件‘/usr/local/jpeg6/bin/cjpeg’: 没有那个文件或目录
make: *** [install] Error 1
# mkdir /usr/local/jpeg6/bin
/usr/bin/install -c -m 644 ./cjpeg.1 /usr/local/jpeg6/man/man1/cjpeg.1
/usr/bin/install: 无法创建一般文件‘/usr/local/jpeg6/man/man1/cjpeg.1’: 没有那个文件或目录
make: *** [install] Error 1
# mkdir /usr/local/jpeg6/man
# mkdir /usr/local/jpeg6/man/man1
# make install
好了,直到安装成功!
安装libpng:
# tar -zxf libpng-1.2.7-config.tar.gz
# cd libpng-1.2.7-config
# ./configure --prefix=/usr/local/libpng2
# make
# make install
安装freetype:
# tar -zxf freetype-2.1.9.tar.gz
# cd freetype-2.1.9
# ./configure --prefix=/usr/local/freetype2
# make
# make install
安装gd库:
# tar -zxf gd-2.0.26gif.tar.gz
# cd gd-2.0.26gif
# ./configure --prefix=/usr/local/gd2 --with-zlib=/usr/local/zlib2/ --with-png=/usr/local/libpng2/ --with-jpeg=/usr/local/jpeg6/ --with-freetype=/usr/local/freetype2/ (请指定及格插件的安装路径,否则安装php的时候可能出错!)
# make
# make install
安装apache,(php5安装环境需要apache2.0.46以上版本,下载的时候注意!)
#tar zxvf httpd-2.0.50.tar.gz
#cd httpd-2.0.50
#./configure --prefix=/usr/local/apache2 --enable-module=so
#make
#make install
安装php5:
# tar -zxf php5-200411260130.tar.gz
# cd php5-200411260130
# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-jpeg-dir=/usr/local/jpeg6/ --with-png-dir=/usr/local/libpng2/ --with-gd=/usr/local/gd2/ --with-freetype-dir=/usr/local/freetype2/ --enable-trace-vars --with-zlib-dir=/usr/local/zlib2/ -with-mysql=/var/lib/mysql
# make
# make install
# cp php.ini-dist /usr/local/php/lib/php.ini
安装libxml的时候如果指定了路径,make的时候可能出错,所以,我安装的时候没指定!
我MAKE PHP4.3.8 和5的时候都遇到:
ext/gd/gd.lo(.text+0x63a): In function `zm_deactivate_gd':
/root/software/php-4.3.8/ext/gd/gd.c:385: undefined reference to `gdFreeFontCache'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php]Error 1
另外还有一个错误可能是什么: libphp.lo的错误(错误当时没有纪录,忘记了,大概是!)
是因为GD库的freetype没装,或者是安装gd库的时候煤油指定插件的路径!!
复制PHP.INI文件到正确位置
在PHP目录下运行
#cp php.ini-dist /usr/local/php/lib/php.ini
编辑apache配置文件httpd.conf
#vi /usr/local/apache2/conf/httpd.conf
要改的有如下几处:
一般都在
#AddType application/x-tar .tgz
下加一行
#LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php
如果你搜索其它地方没有以下这行
LoadModule php5_module modules/libphp5.so
请把上面的#号去掉
还有找到
DirectoryIndex index.html index.html.var
在后面加 index.php 让它把index.php做为默认页
找到
# don't use Group #-1 on these systems!
把下面的用户名和组改为
User apache
Group apache
(原来好像是nobody)
再找
#ServerName
把#去掉,后面的IP改成你的IP.
找到
DocumentRoot "/usr/local/apache2/htdocs"
把/usr/local/apache2/htdocs改为你存放网页文件的路径
为了让中文网页没乱码
找到
AddDefaultCharset iso8859-1
把后面的iso8859-1改为gb2312 或者是干脆off
其他的选项就自己修改吧!或者到http://article.21e.cn 有一个专门的httpd.conf的说明!
保存httpd.conf文件.
启动apache
# /usr/local/apache2/bin/apachectl start
如果没有出错,写一个测试页放到你网页目录下.访问就应该可以看到php的版本等信息了!
如无意外.PHP脚本已经可以连接mysql了.
用ZendOptimizer加速PHP
#tar zxvf ZendOptimizer-2.5.3-linux-glibc21-i386.tar.gz
#cd ZendOptimizer-2.5.3-linux-glibc21-i386
#./install.sh
安装的时候注意输入正确的安装apache的路径等内容!
安装完毕,再看看phpinfo页面的zend选项就发现了!!
如果你以前的apache没有删除,而你又想使用
# /etc/init.d/httpd restart
这样重起apache的话,那就修改/etc/init.d/httpd这个文件,修改其中的apahce的三个路径就可以了!!
好了,终于安装完毕,你的机器已经是最新的apache+php+mysql+gd.......了,恭喜!!
艾,累死我了,整整弄了好几天!!休息了!!~(安装的时候,可能安装的时候和写不不是很一样,不过大同小异!)
同时感谢以前那几位辛苦的安装者,参照你们的文章我才得以顺利安装成功,虽然还是用了好几天!~:P
--------------------------------------------------------------------------------
david5337 回复于:2004-11-28 13:23:55
支持哦!
不想玩儿这个东西!
--------------------------------------------------------------------------------
jzz_zh 回复于:2004-11-28 16:07:48
楼主 的精神可嘉
安装linux的开源软件,还是要多看看软件自身的ReadMe的好
支持一下!!
--------------------------------------------------------------------------------
neohope 回复于:2004-11-28 21:16:11
挺好,支持一下
--------------------------------------------------------------------------------
day-dreamer 回复于:2004-11-30 14:06:34
我安装XPM时出现以下问题,请各位回答一下,谢谢
#rpm -ivh xpm-3.4k-2.i386.rpm
preparing... ################[100%]
file /usr/x11R6/lib/libxpm.so.4.11from install of xpm-3.4k-2 conflicts with file from package XFree86-libs-4.3.0.2
为什么与这个XFree86-libs-4.3.0.2冲突呀,请问要怎么解决呀
--------------------------------------------------------------------------------
hutuworm 回复于:2004-11-30 14:37:40
rpm -ivh xpm-3.4k-2.i386.rpm --force
--------------------------------------------------------------------------------
day-dreamer 回复于:2004-11-30 14:44:33
谢谢hutuworm,已经可以了.
--------------------------------------------------------------------------------
day-dreamer 回复于:2004-11-30 14:55:03
还有以下问题
#tar -zxf gd-2.0.26gif.tar.gz
#cd ga-2.0.26gif
#./configure --prefix=/usr/local/gd2 --with-zlib=/usr/local/zlib2/ --with-png=/usr/local/libpng2/ --with-jpeg=/usr/local/jpeg6/ --with-freetype=/usr/local/freetype2/
到最后时
configuration summary for gd 2.0.26
support for PNG library : yes
support for JPEG library: no
support for Freetype 2.x library:yes
support for Xpm library : no
support for pthreads: yes
以上信息是不是表示不支持JPEG 和 Xpm呀?但是我都已经装了jpegsrc.v6b.tar.gz 和xpm了,请问这个问题怎么处理呢
--------------------------------------------------------------------------------
xuanxuanmylove 回复于:2004-11-30 15:06:31
顶
--------------------------------------------------------------------------------
ecto 回复于:2004-12-01 19:57:03
to:day-dreamer
你安装jpeg的时候指定安装路径了吗?
也就是说你确定你的jpeg是安装到了:
usr/local/jpeg6/ 下吗?
如果不是,安装jpeg的时候指定一下就可以了!
--------------------------------------------------------------------------------
yudi2006 回复于:2004-12-01 20:06:57
我很菜啊
我还看不懂得啦
--------------------------------------------------------------------------------
peng 回复于:2004-12-01 22:16:40
就是要设置环境变量,让系统知道从那里找到它。。
--------------------------------------------------------------------------------
livid 回复于:2004-12-01 23:46:06
有必要这么累吗?干嘛不用 Debian?
--------------------------------------------------------------------------------
cbwcbj 回复于:2005-03-22 12:50:08
我按照楼主的方法安装下去,成功了,我已经确定安装了jpeg,但jpeg不行
在有需要用到图片显示是系统提示:Fatal error: Call to undefined function Imagejpeg()
还要在 apache里打开jpeg功能吗?
--------------------------------------------------------------------------------
zhaodahe 回复于:2005-03-23 13:07:34
good
--------------------------------------------------------------------------------
gudai 回复于:2005-06-29 19:57:55
my configure args
'./configure' '--host=i386-redhat-linux' '--build=i386-redhat-linux' '--target=i386-redhat-linux-gnu' '--program-prefix=' \
'--prefix=/usr/local/php4b' \
'--with-apxs2=/usr/local/apache2/bin/apxs' \
'--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' \
'--with-config-file-path=/etc/php4b' \
'--with-config-file-scan-dir=/etc/php.d' \
'--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' \
'--disable-rpath' '--enable-inline-optimization' \
'--with-db4=/usr' '--with-curl' '--with-exec-dir=/usr/bin' \
'--with-freetype-dir=/usr/local/freetype2/' \
'--with-png-dir=/usr/local/libpng2/' \
'--with-gd=/usr/local/gd2/' '--enable-gd-native-ttf' \
'--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' \
'--with-jpeg-dir=/usr' '--with-openssl' \
'--with-png-dir=/usr/local/libpng2/' \
'--with-zlib-dir=/usr/local/zlib2/' \
'--with-regex=system' \
'--enable-xml' \
'--with-expat-dir=/usr/local/expat2' \
'--with-dom=/usr/local/libxml2' \
'--with-dom-xslt=/usr/local/libxslt2' \
'--with-dom-exslt=/usr/local/libxslt2' \
'--with-xmlrpc=shared' '--with-pcre=/usr' \
'--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-oci8' '--with-pear=/usr/share/pear' '--with-kerberos' '--with-ldap=shared' '--with-mysql' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' \
--------------------------
It cant be maked in the xml parser position
configure will success,but make will failed in xml position
if i cut the --enable-xml and --with-expat-dir
then make passed.
why ?
my expat version is expat-1.95.5-2.
I upgrade it to 1.95.8
nothing changed, i still get failure
--------------------------------------------------------------------------------
gudai 回复于:2005-06-29 20:00:05
frendily tips:
You can use my configuration
What you need is just a little modified
--------------------------------------------------------------------------------
gudai 回复于:2005-06-29 20:44:47
Sorry
you can copy the configure codes into a new shell script like myinstall.sh
and take it to the php install directory
then everything will be simple and debug become freely and pleasure .
安装环境:linux9.0,在配置防火墙的时候要打开ssh/www
以下是我在安装的时候所用的软件清单:
php-4.3.3.tar.bz
gd-2.0.15.tar.gz
jpeg-v6b.tar.gz
libpng-1.2.5.tar.gz
zlib-1.1.4.tar.gz
freetype-2.1.5.tar.bz2
httpd-2.0.47.tar.gz
php-4.3.3.tar.gz
1、安装jpeg-6b
#./configure
#make
编译成功,但是在安装的时候报错,系统提示不能将文件拷贝到/usr/local/man/man1这个目录,于是建立目录以后安装成功:
#mkdir /usr/local/man & /usr/local/man/man1
安装记录
# make install
# make install-lib //以前因为没有执行这一步安装导致在编译php时报错
2、libpng-1.2.5的安装配置
#cp scripts/makefile.gcmmx makefile \\makefile.gcmmx是针对MMX指令集优化的
#make && make install
3、zlib-1.1.4安装配置
#./configure --shared \\shared生成zlib的共享库文件
#make && make install
4、freetype-2.1.5安装配置
#./configure
#make && make install
5.gd-1.0.15安装配置
#./configure
配置完成后,注意输出的信息是否如下:
** Configuration summary for gd 2.0.15:
Support for PNG library: yes
Support for JPEG library: yes
Support for Freetype 2.x library: yes
Support for Xpm library: no
Xpm库以前安装不成功,如果程序部门不常用用,一般PNG/JPEG/FREETYPE三个库打开支持就行
#make && make install
#cp gd.h /usr/local/lib \\编译PHP的时候会缺少这个文件出错
6、apache2.0.47安装配置
#./configure --prefix=/www/httpd --enable-so
#make && make install
\\安装成功
7、php-4.3.3安装配置
# ./configure --prefix=/www/httpd/php --with-apxs2=/www/httpd/bin/apxs --enable-track-vars --with-zlib-dir=/usr/local/lib
--with-gd=/usr/local/lib --enable-sysvmsg --enable-sockets --enable-sysvshm --enable-sysvsem
--enable-gd-native-ttf --with-ttf=/usr/lib --disable-debug --with-tiff-dir=/usr/lib
--with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/local/lib --with-mysql --with-xml --with-gdbm-dir=/usr/lib
--enable-ftp --enable-inline-optimization --with-gettext=/usr/lib --enable-magic-quotes --enable-safe-mode
--enable-bcmath --enable-wddx --with-freetype-dir=/usr/local/lib
#make && make install
\\要把php.ini文件cp到你安装php目录下的lib下面,不然对php.ini的配置不会生效
\\安装成功
再次叩头感谢
借鉴的参考文献
http://chinaunix.net/jh/13/161118.html
http://www.chinaunix.net/jh/13/195204.html
http://www.neweasier.com/article/20...1039947379.html
【发表回复】【查看论坛原帖】【添加到收藏夹】【关闭】
--------------------------------------------------------------------------------
unigium 回复于:2004-01-16 13:01:46
只所以可以安装成功,就是要有耐性,你所想的其实大部分前辈们已经有写好的帖子在这里,我们要认真的找,然后根据自己的情况组合起来^-^
真开心
--------------------------------------------------------------------------------
好好先生 回复于:2004-01-16 13:28:42
祝贺你!
--------------------------------------------------------------------------------
unigium 回复于:2004-01-16 13:52:30
谢谢你的帮助,兄弟!
--------------------------------------------------------------------------------
small-bird 回复于:2004-01-30 14:40:18
http://bbs.chinaunix.net/forum/viewtopic.php?t=244551
存在这个问题吗?
linux下安装最新apache2.0.52+php5+gd2+mysql 由 于gd2才开始支持真彩图片的创建,所以,,升级服务器,因为原来的安装都是默认的系统安装,也更因为是个菜鸟,所以,安装很困难,起初根据网上一些文章 在我的red hat A 3 上安装测试,不过,测试了安装php4.3.X 和php5.0.X都没有成功,最后,根据其他人的文章,自己搞了将近3天,终于安装上了,下面就我安装中出现的错误和过程写出来和大家分享,以免有像我 一样的菜鸟们走弯路! (我可是两天多的时间,安装php的次数不下50次得来的经验,希望大家多多支持,有错误当然欢迎给我指正!转载请注明来自中国智慧在线(http: //article.21e.cn ,谢谢!),以下经过测试在red hat 9 和red hat A 3上通过!
欢迎转载,但是请注明原出处:http://article.21e.cn !!谢谢!
如果你机器里原来装有了PHP或者APACHE的RPM或者低版本.你可以现删除,删除安装简洁一些,不过我的实际操作过程是煤油删除,而直接安装的.当然你也可以跟我一样!
首先,服务器GCC要有,不然什么都不能做.可以用gcc -v来查看是否安装了GCC,
#gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
Thread model: posix
gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-34)
有以上类似信息说明已有GCC,
没有就现安装吧,至于如何安装,我就不说了,可以用光盘安装或者是下载源文件都可以,当然你的版本不一定是3.2.3!
请下载以下所有的东西:
httpd-2.0.X.tar.gz 版本最好是下载最新的啦,下载地址:http://www.apache.org
MySQL-client-4.0.20-0.i386.rpm
MySQL-server-4.0.20-0.i386.rpm(如果你打算升级mysql的话请下载,下载地址:http: //www.mysql.org 当然也是下载最新的版本最好了,由于我不打算安装mysql,就省略了,安装的时候的步骤也是先安装mysql!)
php-5.0.X.tar.gz 下载地址:http://www.php.net
ZendOptimizer-2.5.3-linux-glibc21-i386.tar.gz
zend的最新版安装是好像有点问题,就下载这个版本就可以,zend用来加速php,你可以选择不安装!下载地址:http: //www.zend.com
gd-2.0.28.tar.gz 这个软件的下载地址,php推荐的是:http://www.boutell.com/gd/ 但是由于某些原因,开发者不支持gif图像的创建,这有点不太方便,所以,我下载了个支持gif图像的,也就是打了gif补丁的:http: //www.rime.com.au/gd/
libxml2-2.X.X.tar.gz 下载地址:
zlib-1.X.X.tar.gz 忘记了,自己找一下吧
jpegsrc.v6b.tar.gz 下载地址:ftp://ftp.uu.net/graphics/jpeg/
libpng-1.2.5.tar.gz 下载地址:http://www.libpng.org/pub/png/libpng.html
freetype2-X.X.tar.gz 下载地址:http://www.fretype.org
xpm-3.4k-2.i386.rpm 忘记了,自己找一下吧
以上都是我下载的官方地址,软件的版本中的X,你自己看看你想用哪个版,不过最好是用最新稳定版本的!如果你以前安装过上述软件的其他版本,你也可以选择不安装!
安装MYSQL 服务器:
#rpm -ivh MySQL-server-4.0.20-0.i386.rpm
#rpm -ivh MySQL-client-4.0.20-0.i386.rpm
安装好后试试能不能用
#mysql 如果设置了密码后测试方法是(mysql -u root -proot -h localhost 注意的是-p后煤没有空格,直接跟密码)
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 27651 to server version: 4.0.20-standard
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
说明可以了!
请自己改mysql的密码,方法不说了!
安装XPM
#rpm -ivhxpm-3.4k-2.i386.rpm
安装libxml
# tar -zxf libxml2-2.6.16.tar.gz
# cd libxml2-2.6.16
# ./configure (xml默认安装就可以,不要指定路径了,因为安装时php可能找不到它,PHP5只支持libxml2-2.5.10以上版本)
# make
# make install
安装zlib
# tar -zxf zlib-1.2.2.tar.gz
# cd zlib-1.2
# ./configure --prefix=/usr/local/zlib2 (注意,如果您以前没有安装zlib,可以不指定路径,我是没有删除以前的低版本才指定的!以下雷同!)
# make
# make install
安装jpeg
# tar -zxf jpegsrc.v6b.tar.gz
# cd jpeg-6b/
# ./configure --prefix=/usr/local/jpeg6
# make
# make install-lib
如果你选择默认安装,可能很顺利,指定路径后,请先创建以下文件夹
错误提示:...... /usr/bin/install -c -m 644 jconfig.h /usr/local/jpeg6/include/jconfig.h
/usr/bin/install: 无法创建一般文件‘/usr/local/jpeg6/include/jconfig.h’: 没有那个文件或目录
make: *** [install-headers] Error 1
# mkdir /usr/local/jpeg6
# mkdir /usr/local/jpeg6/include
# mkdir /usr/local/jpeg6/lib
# make install-lib
# make install
安装时如果错误提示:
/usr/bin/install: 无法创建一般文件‘/usr/local/jpeg6/lib/libjpeg.a’: 没有那个文件或目录
make: *** [install-lib] Error 1
创建如下文件夹:
# mkdir /usr/local/jpeg6/lib
# make install
/usr/bin/install -c cjpeg /usr/local/jpeg6/bin/cjpeg
/usr/bin/install: 无法创建一般文件‘/usr/local/jpeg6/bin/cjpeg’: 没有那个文件或目录
make: *** [install] Error 1
# mkdir /usr/local/jpeg6/bin
/usr/bin/install -c -m 644 ./cjpeg.1 /usr/local/jpeg6/man/man1/cjpeg.1
/usr/bin/install: 无法创建一般文件‘/usr/local/jpeg6/man/man1/cjpeg.1’: 没有那个文件或目录
make: *** [install] Error 1
# mkdir /usr/local/jpeg6/man
# mkdir /usr/local/jpeg6/man/man1
# make install
好了,直到安装成功!
安装libpng:
# tar -zxf libpng-1.2.7-config.tar.gz
# cd libpng-1.2.7-config
# ./configure --prefix=/usr/local/libpng2
# make
# make install
安装freetype:
# tar -zxf freetype-2.1.9.tar.gz
# cd freetype-2.1.9
# ./configure --prefix=/usr/local/freetype2
# make
# make install
安装gd库:
# tar -zxf gd-2.0.26gif.tar.gz
# cd gd-2.0.26gif
# ./configure --prefix=/usr/local/gd2 --with-zlib=/usr/local/zlib2/ --with-png=/usr/local/libpng2/ --with-jpeg=/usr/local/jpeg6/ --with-freetype=/usr/local/freetype2/ (请指定及格插件的安装路径,否则安装php的时候可能出错!)
# make
# make install
安装apache,(php5安装环境需要apache2.0.46以上版本,下载的时候注意!)
#tar zxvf httpd-2.0.50.tar.gz
#cd httpd-2.0.50
#./configure --prefix=/usr/local/apache2 --enable-module=so
#make
#make install
安装php5:
# tar -zxf php5-200411260130.tar.gz
# cd php5-200411260130
# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-jpeg-dir=/usr/local/jpeg6/ --with-png-dir=/usr/local/libpng2/ --with-gd=/usr/local/gd2/ --with-freetype-dir=/usr/local/freetype2/ --enable-trace-vars --with-zlib-dir=/usr/local/zlib2/ -with-mysql=/var/lib/mysql
# make
# make install
# cp php.ini-dist /usr/local/php/lib/php.ini
安装libxml的时候如果指定了路径,make的时候可能出错,所以,我安装的时候没指定!
我MAKE PHP4.3.8 和5的时候都遇到:
ext/gd/gd.lo(.text+0x63a): In function `zm_deactivate_gd':
/root/software/php-4.3.8/ext/gd/gd.c:385: undefined reference to `gdFreeFontCache'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php]Error 1
另外还有一个错误可能是什么: libphp.lo的错误(错误当时没有纪录,忘记了,大概是!)
是因为GD库的freetype没装,或者是安装gd库的时候煤油指定插件的路径!!
复制PHP.INI文件到正确位置
在PHP目录下运行
#cp php.ini-dist /usr/local/php/lib/php.ini
编辑apache配置文件httpd.conf
#vi /usr/local/apache2/conf/httpd.conf
要改的有如下几处:
一般都在
#AddType application/x-tar .tgz
下加一行
#LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php
如果你搜索其它地方没有以下这行
LoadModule php5_module modules/libphp5.so
请把上面的#号去掉
还有找到
DirectoryIndex index.html index.html.var
在后面加 index.php 让它把index.php做为默认页
找到
# don't use Group #-1 on these systems!
把下面的用户名和组改为
User apache
Group apache
(原来好像是nobody)
再找
#ServerName
把#去掉,后面的IP改成你的IP.
找到
DocumentRoot "/usr/local/apache2/htdocs"
把/usr/local/apache2/htdocs改为你存放网页文件的路径
为了让中文网页没乱码
找到
AddDefaultCharset iso8859-1
把后面的iso8859-1改为gb2312 或者是干脆off
其他的选项就自己修改吧!或者到http://article.21e.cn 有一个专门的httpd.conf的说明!
保存httpd.conf文件.
启动apache
# /usr/local/apache2/bin/apachectl start
如果没有出错,写一个测试页放到你网页目录下.访问就应该可以看到php的版本等信息了!
如无意外.PHP脚本已经可以连接mysql了.
用ZendOptimizer加速PHP
#tar zxvf ZendOptimizer-2.5.3-linux-glibc21-i386.tar.gz
#cd ZendOptimizer-2.5.3-linux-glibc21-i386
#./install.sh
安装的时候注意输入正确的安装apache的路径等内容!
安装完毕,再看看phpinfo页面的zend选项就发现了!!
如果你以前的apache没有删除,而你又想使用
# /etc/init.d/httpd restart
这样重起apache的话,那就修改/etc/init.d/httpd这个文件,修改其中的apahce的三个路径就可以了!!
好了,终于安装完毕,你的机器已经是最新的apache+php+mysql+gd.......了,恭喜!!
艾,累死我了,整整弄了好几天!!休息了!!~(安装的时候,可能安装的时候和写不不是很一样,不过大同小异!)
同时感谢以前那几位辛苦的安装者,参照你们的文章我才得以顺利安装成功,虽然还是用了好几天!~:P
--------------------------------------------------------------------------------
david5337 回复于:2004-11-28 13:23:55
支持哦!
不想玩儿这个东西!
--------------------------------------------------------------------------------
jzz_zh 回复于:2004-11-28 16:07:48
楼主 的精神可嘉
安装linux的开源软件,还是要多看看软件自身的ReadMe的好
支持一下!!
--------------------------------------------------------------------------------
neohope 回复于:2004-11-28 21:16:11
挺好,支持一下
--------------------------------------------------------------------------------
day-dreamer 回复于:2004-11-30 14:06:34
我安装XPM时出现以下问题,请各位回答一下,谢谢
#rpm -ivh xpm-3.4k-2.i386.rpm
preparing... ################[100%]
file /usr/x11R6/lib/libxpm.so.4.11from install of xpm-3.4k-2 conflicts with file from package XFree86-libs-4.3.0.2
为什么与这个XFree86-libs-4.3.0.2冲突呀,请问要怎么解决呀
--------------------------------------------------------------------------------
hutuworm 回复于:2004-11-30 14:37:40
rpm -ivh xpm-3.4k-2.i386.rpm --force
--------------------------------------------------------------------------------
day-dreamer 回复于:2004-11-30 14:44:33
谢谢hutuworm,已经可以了.
--------------------------------------------------------------------------------
day-dreamer 回复于:2004-11-30 14:55:03
还有以下问题
#tar -zxf gd-2.0.26gif.tar.gz
#cd ga-2.0.26gif
#./configure --prefix=/usr/local/gd2 --with-zlib=/usr/local/zlib2/ --with-png=/usr/local/libpng2/ --with-jpeg=/usr/local/jpeg6/ --with-freetype=/usr/local/freetype2/
到最后时
configuration summary for gd 2.0.26
support for PNG library : yes
support for JPEG library: no
support for Freetype 2.x library:yes
support for Xpm library : no
support for pthreads: yes
以上信息是不是表示不支持JPEG 和 Xpm呀?但是我都已经装了jpegsrc.v6b.tar.gz 和xpm了,请问这个问题怎么处理呢
--------------------------------------------------------------------------------
xuanxuanmylove 回复于:2004-11-30 15:06:31
顶
--------------------------------------------------------------------------------
ecto 回复于:2004-12-01 19:57:03
to:day-dreamer
你安装jpeg的时候指定安装路径了吗?
也就是说你确定你的jpeg是安装到了:
usr/local/jpeg6/ 下吗?
如果不是,安装jpeg的时候指定一下就可以了!
--------------------------------------------------------------------------------
yudi2006 回复于:2004-12-01 20:06:57
我很菜啊
我还看不懂得啦
--------------------------------------------------------------------------------
peng 回复于:2004-12-01 22:16:40
就是要设置环境变量,让系统知道从那里找到它。。
--------------------------------------------------------------------------------
livid 回复于:2004-12-01 23:46:06
有必要这么累吗?干嘛不用 Debian?
--------------------------------------------------------------------------------
cbwcbj 回复于:2005-03-22 12:50:08
我按照楼主的方法安装下去,成功了,我已经确定安装了jpeg,但jpeg不行
在有需要用到图片显示是系统提示:Fatal error: Call to undefined function Imagejpeg()
还要在 apache里打开jpeg功能吗?
--------------------------------------------------------------------------------
zhaodahe 回复于:2005-03-23 13:07:34
good
--------------------------------------------------------------------------------
gudai 回复于:2005-06-29 19:57:55
my configure args
'./configure' '--host=i386-redhat-linux' '--build=i386-redhat-linux' '--target=i386-redhat-linux-gnu' '--program-prefix=' \
'--prefix=/usr/local/php4b' \
'--with-apxs2=/usr/local/apache2/bin/apxs' \
'--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' \
'--with-config-file-path=/etc/php4b' \
'--with-config-file-scan-dir=/etc/php.d' \
'--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' \
'--disable-rpath' '--enable-inline-optimization' \
'--with-db4=/usr' '--with-curl' '--with-exec-dir=/usr/bin' \
'--with-freetype-dir=/usr/local/freetype2/' \
'--with-png-dir=/usr/local/libpng2/' \
'--with-gd=/usr/local/gd2/' '--enable-gd-native-ttf' \
'--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' \
'--with-jpeg-dir=/usr' '--with-openssl' \
'--with-png-dir=/usr/local/libpng2/' \
'--with-zlib-dir=/usr/local/zlib2/' \
'--with-regex=system' \
'--enable-xml' \
'--with-expat-dir=/usr/local/expat2' \
'--with-dom=/usr/local/libxml2' \
'--with-dom-xslt=/usr/local/libxslt2' \
'--with-dom-exslt=/usr/local/libxslt2' \
'--with-xmlrpc=shared' '--with-pcre=/usr' \
'--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-oci8' '--with-pear=/usr/share/pear' '--with-kerberos' '--with-ldap=shared' '--with-mysql' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' \
--------------------------
It cant be maked in the xml parser position
configure will success,but make will failed in xml position
if i cut the --enable-xml and --with-expat-dir
then make passed.
why ?
my expat version is expat-1.95.5-2.
I upgrade it to 1.95.8
nothing changed, i still get failure
--------------------------------------------------------------------------------
gudai 回复于:2005-06-29 20:00:05
frendily tips:
You can use my configuration
What you need is just a little modified
--------------------------------------------------------------------------------
gudai 回复于:2005-06-29 20:44:47
Sorry
you can copy the configure codes into a new shell script like myinstall.sh
and take it to the php install directory
then everything will be simple and debug become freely and pleasure .
相关阅读 更多 +
排行榜 更多 +