整合apache mysql php gd
先安装mysql
MySQL-server-5.0.51a-0.glibc23.i386.rpm
MySQL-client-5.0.51a-0.glibc23.i386.rpm
也没什么只是rpm -ivh 。。。。。而已
-----------------------------------------------------------
接着安装apache
软件 httpd-2.0.54.tar.bz2
#bzip2 -d httpd-2.0.54.tar.bz2
#tar -vxf httpd-2.0.54.tar
//把目录移到src下面 /usr/local/src/ 就等同于xp c盘的program files
#mv httpd-2.0.54 /usr/local/src/
#cd httpd-2.0.54
#./configure --help //查看帮助
#./configure --prefix=/etc/httpd / --prefix是安装的路径 而--syscongfing=/etc就是配置文
>--enable-module=so 件放置的路径(httpd.conf)
--enable-module=so 就是支持的模块so
之后
#make
#make install
安装完后 可以执行开启关闭重启
#/etc/httpd/bin/apachectl start
如果没指定安装路径则默认是/usr/local/apache2/ 所以如下:
#/usr/local/apache2/bin/apachectl start
#/usr/local/apache2/bin/apachectl stop
#/usr/local/apache2/bin/apachectl restart
注意:如果启动服务器时发现
could not determine the server's fully qualified domain name .....
那就要修改httpd.conf配置里面的ServerName 改成自己的ip:80
------------------------------------------------------------------------
安装gd库
前提要安装jpeg-6b
把jpeg-6b移动到/usr/local/src下
进入jpeg-6b目录
./configure
make
make install
注意当用make install时候出现了一个小小的错误
说 /usr/local/man/man1/cjpeg.1ff 没那个文件
建立个目录就可以了
#mkdir -p /usr/local/man/man1
再执行make install
最后还要执行一步
make install-lib
安装ttf 这个是支持字体的
软件 freetype-2.1.9.tar.bz2
把freetype-2.1.9移动到/usr/local/src下
进入freetype-2.1.9目录
./configure
make
make install
安装zlib-1.2.3.tar.gz
把zlib-1.2.3移动到/usr/local/src下
进入zlib-1.2.3目录
./configure
make
make install
安装libpng-1.2.10.tar.bz2
把libpng-1.2.10移动到/usr/local/src下
进入libpng-1.2.10目录
./configure
make
make install
安装gd库
软件gd-2.0.33.tar.gz
#tar -zvxf gd-2.0.33.tar.gz
#mv gd-2.0.33 /usr/local/src
进入gd-2.0.33目录
./configure
make
make install
cp gd.h /usr/local/lib/
安装 libxml 来更新redhat9版本的因为太旧了
软件 libxml2-2.6.24.tar.bz2
------------------------------------------------------------------------------------------
安装php
软件php-5.2.6.tar.bz2
解压并把php-5.2.6移动到/usr/local/src下
进入php-5.2.6目录
./configure --prefix=/usr/local/php /
>--with-apxs2=/etc/httpd/bin/apxs --with-gd /
>--with-jpeg-dir --with-ttf --with-dir --with-png-dir /
>--with-mysql --wnable-track-vars
注意如果 mysql是编译安装的就要指定mysql的安装目录
这是动态编译 把php编译成apache的一个动态模块
看看这个参数就知道了--with-apxs2=/etc/httpd/bin/apxs
看到thank you for using php 就是配置成功了 接着
make 和make test 最后make install
安装成功后
cp php.ini-dist /usr/local/php/lib/php.ini
做完上面步骤后在apache服务器加入支持php语言设置
加入php支持
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
加php索引index.php
DirectoryIndex index.php index.html index.html.var
好了测试建立个test.php文档放到/etc/httpd/htpdocs目录下
内容为
<?php phoinfo() ?>
保存退出
启动apache服务器
浏览器输入 http://ip/test.php 能看php一个信息页面则配置成功了
注释:如果想加速服务器可以装zend 大家可以网上找下资料