2024年6月11日发(作者:)

CentOS5.5+Apache2.2.15+Mysql5.1.48+PHP5.2.13 编译安装

画符抓鬼撰聊斋 | CentOS5.5+Apache2.2.15+Mysql5.1.48+PHP5.2.13 编译安装

CentOS5.5+Apache2.2.15+Mysql5.1.48+PHP5.2.13 编译安装

请从各自的官方下载 PHP官方有发布新的5.3.2在centos5.5的gcc环境下编译会错误,所以选择比较稳定的5.2.13版本

update 检查系统更新

install gcc gcc-c++ 软件编译环境

erase httpd 卸载系统自带的httpd (apache2.2.3)

install zlib-devel libtool ncurses-devel libxml2-devel

(zlib-devel 安装apache需要,否则出错 .libtool安装mysql时候需要.同时附带了autoconf automake imake 编译mysql

5.1.48时候会出错 需要autoconf重新配置一下)

5.编译apache2.2.15

./configure –prefix=/usr/local/apache2 –enable-rewrite=shared –enable-track-vars –enable-cgi –enable-so –

enable-mods-shared=all –with-config-file-path=/usr/local/apache2/conf –with-mpm=worker –enable-speling

make

make install

make clean

6.编译 . 去掉#ServerName 前面的# 没有ServerName启动httpd服务会出错. 给LoadModule

unique_id_module modules/mod_unique_前面加上注释以取消加载.默认的centos5.5加载这个会启动不了httpd .

7.运行 grep -v “#” /usr/local/apache2/bin/apachectl > /etc/init.d/httpd

8.运行 chmod +x /etc/init.d/httpd (赋予httpd可以运行的权限)

9.编译/etc/init.d/httpd 在起始位置添加

#!/bin/sh

# chkconfig: 8854 85 15

# description: Apache is a World Wide Web server.

10.运行 chkconfig –add httpd

chkconfig –level 35 httpd on

11.编译mysql 5.1.48

groupadd mysql

useradd -g mysql mysql

在源码文件夹目录运行

autoreconf –force –install

./configure –prefix=/usr/local/mysql –with-charset=utf8 –with-extra-charsets=all –enable-thread-safe-client

–enable-assembler –with-readline –with-big-tables –with-plugins=all –with-tcp-port=3310 –

with-unix-socket-path=/var/tmp/ –with-mysqld-ldflags=-all-static –with-client-ldflags=-all-static

make

make install

make clean

以下命令在mysql安装目录下运行

cd /usr/local/mysql

cp /usr/local/mysql/share/mysql/ /etc/

cp /usr/local/mysql/share/mysql/ /etc/init.d/mysqld

chmod +x /etc/init.d/mysqld

chown -R mysql .

chgrp -R mysql .

scripts/mysql_install_db –user=mysql