CentOS5下编译安装apache+php
2010-01-13 21:14
453 查看
前段时间研究了下centos下的apache和php的编译安装,一下是我的编译过程,前提是已经安装 好了mysql了
1.下载安装包
用wget :
apache:http://www.apache.org/dist/httpd/httpd-2.2.14.tar.bz2
php:http://cn2.php.net/get/php-5.3.0.tar.bz2/from/us.php.net/mirror
2.解压到/usr/local/src下,先编译apache,在编译php
apache编译参数:
apache:/configure --prefix=/usr/local/apache2 --with-mpm=worker --enable-so --enable-rewrite --enable-cache
--enable-file-cache --enable-disk-cache --enable-mem-cache --enable-deflate --enable-expires --enable-headers
--disable-actions --disable-cgid --disable-cgi --disable-autoindex --disable-userdir --disable-alias --disable-include
--enable-proxy-ajp --enable-proxy --enable-proxy-balancer
make
make install
在apache的编译安装中,一半会报mysqlclient包没有安装,centos下,用yum install mysql-devel就可以了,其他的一些包类似安装就可以
php编译参数:
./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-libxml-dir --with-zlib
--with-bz2 --enable-calendar --enable-ftp --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --with-freetype-dir
--enable-gd-native-ttf --enable-mbstring --with-mysql --with-mysqli=/usr/bin/mysql_config
--with-mysql-sock=/var/lib/mysql/mysql.sock --enable-sockets --with-xsl --enable-zip
--enable-zend-multibyte --with-curl=/usr --with-openssl
make
make install
到此,apache和php的编译安装基本上就结束了,下面就是一些配置问题了!!
附上我在网上找的部分apache的编译参数的说明:
/configure //配置源代码树 --prefix=/usr/local/apache2 //体系无关文件的顶级安装目录PREFIX ,也就Apache的安装目录。
--enable-module=so //打开 so 模块,so 模块是用来提 DSO 支持的 apache 核心模块
--enable-deflate=shared //支持网页压缩
--enable-expires=shared //支持 HTTP 控制
--enable-rewrite=shared //支持 URL 重写
--enable-cache //支持缓存
--enable-file-cache //支持文件缓存
--enable-mem-cache //支持记忆缓存
--enable-disk-cache //支持磁盘缓存
--enable-static-support //支持静态连接(默认为动态连接)
--enable-static-htpasswd //使用静态连接编译 htpasswd - 管理用于基本认证的用户文件
--enable-static-htdigest //使用静态连接编译 htdigest - 管理用于摘要认证的用户文件
--enable-static-rotatelogs //使用静态连接编译 rotatelogs - 滚动 Apache 日志的管道日志程序
--enable-static-logresolve //使用静态连接编译 logresolve - 解析 Apache 日志中的IP地址为主机名
--enable-static-htdbm //使用静态连接编译 htdbm - 操作 DBM 密码数据库
--enable-static-ab //使用静态连接编译 ab - Apache HTTP 服务器性能测试工具
--enable-static-checkgid //使用静态连接编译 checkgid
--disable-cgid //禁止用一个外部 CGI 守护进程执行CGI脚本
--disable-cgi //禁止编译 CGI 版本的 PHP --disable-userdir //禁止用户从自己的主目录中提供页面
--with-mpm=worker // 让apache以worker方式运行
--enable-authn-dbm=shared // 对动态数据库进行操作。Rewrite时需要。
1.下载安装包
用wget :
apache:http://www.apache.org/dist/httpd/httpd-2.2.14.tar.bz2
php:http://cn2.php.net/get/php-5.3.0.tar.bz2/from/us.php.net/mirror
2.解压到/usr/local/src下,先编译apache,在编译php
apache编译参数:
apache:/configure --prefix=/usr/local/apache2 --with-mpm=worker --enable-so --enable-rewrite --enable-cache
--enable-file-cache --enable-disk-cache --enable-mem-cache --enable-deflate --enable-expires --enable-headers
--disable-actions --disable-cgid --disable-cgi --disable-autoindex --disable-userdir --disable-alias --disable-include
--enable-proxy-ajp --enable-proxy --enable-proxy-balancer
make
make install
在apache的编译安装中,一半会报mysqlclient包没有安装,centos下,用yum install mysql-devel就可以了,其他的一些包类似安装就可以
php编译参数:
./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-libxml-dir --with-zlib
--with-bz2 --enable-calendar --enable-ftp --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --with-freetype-dir
--enable-gd-native-ttf --enable-mbstring --with-mysql --with-mysqli=/usr/bin/mysql_config
--with-mysql-sock=/var/lib/mysql/mysql.sock --enable-sockets --with-xsl --enable-zip
--enable-zend-multibyte --with-curl=/usr --with-openssl
make
make install
到此,apache和php的编译安装基本上就结束了,下面就是一些配置问题了!!
附上我在网上找的部分apache的编译参数的说明:
/configure //配置源代码树 --prefix=/usr/local/apache2 //体系无关文件的顶级安装目录PREFIX ,也就Apache的安装目录。
--enable-module=so //打开 so 模块,so 模块是用来提 DSO 支持的 apache 核心模块
--enable-deflate=shared //支持网页压缩
--enable-expires=shared //支持 HTTP 控制
--enable-rewrite=shared //支持 URL 重写
--enable-cache //支持缓存
--enable-file-cache //支持文件缓存
--enable-mem-cache //支持记忆缓存
--enable-disk-cache //支持磁盘缓存
--enable-static-support //支持静态连接(默认为动态连接)
--enable-static-htpasswd //使用静态连接编译 htpasswd - 管理用于基本认证的用户文件
--enable-static-htdigest //使用静态连接编译 htdigest - 管理用于摘要认证的用户文件
--enable-static-rotatelogs //使用静态连接编译 rotatelogs - 滚动 Apache 日志的管道日志程序
--enable-static-logresolve //使用静态连接编译 logresolve - 解析 Apache 日志中的IP地址为主机名
--enable-static-htdbm //使用静态连接编译 htdbm - 操作 DBM 密码数据库
--enable-static-ab //使用静态连接编译 ab - Apache HTTP 服务器性能测试工具
--enable-static-checkgid //使用静态连接编译 checkgid
--disable-cgid //禁止用一个外部 CGI 守护进程执行CGI脚本
--disable-cgi //禁止编译 CGI 版本的 PHP --disable-userdir //禁止用户从自己的主目录中提供页面
--with-mpm=worker // 让apache以worker方式运行
--enable-authn-dbm=shared // 对动态数据库进行操作。Rewrite时需要。
相关文章推荐
- 编译安装mysql+apache+php
- 基于apache + mysql + php编译安装过程详解
- 编译安装Apache+PHP
- 如何查看已经编译安装好的nginx、apache、php、mysql的编译参数?
- wdOS系统下源码编译安装LAMP环境(linux+apache+php+mysql)
- RHEL 6.5 64bit下源码编译安装LAMP(Apache 2.4.12、MySQL 5.5.42、PHP 5.3.10)
- Apache 配置------FastCGI方式使用PHP(包含:linux下编译安装fmod_fcgid,配置apache以支持FastCGI)
- apache/mysql/php编译安装及支持xcache和fastcgi方式运行
- Centos 6编译安装apache&PHP&mysql
- ubuntu 14.04 编译安装 apache 和 php
- 手工编译安装php后,重启apache时,libphp5.so: cannot restore segment prot after reloc: Permission denied 错误的解决办法
- 获取安装后Apache、MySQL、Nginx、PHP编译时参数
- CentOS 源码编译安装LAMP(Apache MySQL PHP)
- CentOS6 编译安装LAMP(Apache-httpd2.4,Mariadb,php)_2015092001
- 在ubuntu linux下以编译方式安装LAMP(apache mysql php)环境
- Linux下Php5+Mysql5+Apache2+GD2+Zend3最新版本软件编译安装步骤
- centos5 源码安装Nginx + mysql + apache + php的方法
- Linux+php+apache+oracle环境搭建之CentOS下源码编译安装PHP
- Centos6.7 编译安装 Apache PHP
- centos7上编译安装php7,以php-fpm方式连接apache