php+5.2+x86,Linux(X86_64)+Apache2.2.4+PHP5.2.3+Mysql5.0.45+GD2

Linux(X86_64)+Apache2.2.4+PHP5.2.3+Mysql5.0.45+GD2+Zend配置方案

我的系统环境为:CentOS 64位操作系统

服务器为Dell 1950服务器

由于我全是用源代码安装,大多适用于其它的操作系统

由于CentOS与redhat的关系,基本是适用于redhat linux as 5

下载相关软件

wget

wget

wget

wget

wget

我全部是下载源代码编译方式进行安装的

一、先安装Mysql

groupadd mysql

useradd -g mysql mysql

tar zxvf mysql-5.0.45.tar.gz

cd mysql-5.0.45

./configure --prefix=/usr/local/mysql

make

make install clean

cp support-files/my-medium.cnf /etc/my.cnf

cd /usr/local/mysql

chown -R mysql . //后面有个点号,要注意了!

chgrp -R mysql . //后面有个点号,要注意了!

bin/mysql_install_db --user=mysql

chown -R root .

chown -R mysql var

bin/mysqld_safe --user=mysql &

如果没有出错的话,这里Mysql应该可以正常启动了。

如果编译时出现了以下错误:

checking for tgetent in -ltermcap... no

checking for termcap functions library... configure: error: No curses/termcap library found

说明 curses/termcap 库没有安装

去下载一个ncurses-5.6.tar.gz,

wget

tar zxvf ncurses-5.6.tar.gz

cd ncurses-5.6

./configure --prefix=/usr --with-shared --without-debug

make

make install clean

然后再重新编译Mysql进行安装。

二、安装GD库和GD库所需的环境

tar zxvf zlib-1.2.3.tar.gz

cd zlib-1.2.3

./configure

make

make install clean

如果编译的时候出现

/usr/bin/ld: /usr/local/lib/libz.a(crc32.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC

/usr/local/lib/libz.a: could not read symbols: Bad value

错误,解决办法请点击查看

tar zxvf libpng-1.2.18.tar.gz

cd libpng-1.2.18

./configure

make

make install clean

tar zxvf freetype-2.3.5.tar.gz

cd freetype-2.3.5

./configure

make

make install clean

tar zxvf jpegsrc.v6b.tar.gz

cd jpeg-6b

./configure

make

make install-lib

如果在编译的时候出现

/usr/bin/ld: /usr/local/lib/libjpeg.a(jcapimin.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC

错误,解决办法请点击查看

如果以上软件都安装成功了,就可以开始安装GD了

tar zxvf gd-2.0.35.tar.gz

cd gd-2.0.35

./configure --with-png --with-freetype --with-jpeg

编译的时候,最后结果那里可以看到

** Configuration summary for gd 2.0.35:

Support for PNG library: yes

Support for JPEG library: yes

Support for Freetype 2.x library: yes

Support for Fontconfig library: no

Support for Xpm library: no

Support for pthreads: yes

可以看到png 、 jpeg 、 freetype都已经安装上了

三、安装Apache2.2.4

tar zxvf httpd-2.2.4.tar.gz

cd httpd-2.2.4

./configure --prefix=/usr/local/apache22 --enable-rewrite=shared --enable-speling=shared --enable-track-vars --enable-cgi --enable-so --enable-mods-shared=all

make

make install clean

安装完后使用/usr/local/apache22/bin/apachectl -k start可以启动

四、安装PHP5.2.3

tar zxvf php-5.2.3.tar.gz

cd php-5.2.3

./configure --prefix=/usr/local/php5 --with-mysql-dir=/usr/local/mysql --with-apxs2=/usr/local/apache22/bin/apxs --with-jpeg --with-freetype --enable-trace-vars --with-zlib --with-gd --enable-ftp --enable-sockets

make

make install

make clean

cp php.ini-dist /usr/local/php5/lib/php.ini

配置 httpd.conf 让apache支持PHP

vi /usr/local/apache/conf/httpd.conf

找到 AddType application/x-gzip .gz .tgz 在其下添加如下内容

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

重启Apache

/usr/local/apache22/bin/apachectl -k restart

编辑一个PHP页面进行测试一下phpinfo.php

五、安装Zend

去官方网站下载ZendOptimizer-3.3.0a-linux-glibc23-x86_64.tar.gz

tar zxvf ZendOptimizer-3.3.0a-linux-glibc23-x86_64.tar.gz

cd ZendOptimizer-3.3.0a-linux-glibc23-x86_64

./install.sh

根据提示安装

注意配置好PHP.ini文件的路径和Apache的Apachectl文件的路径

完成安装!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值