Linux普通用户源码编译安装apache和php(非root用户)

Linux普通用户源码编译安装apache和php(非root用户)

1.下载http://archive.apache.org/dist/apr/apr-1.5.1.tar.gz
2.下载http://archive.apache.org/dist/apr/apr-util-1.5.4.tar.gz
3.下载http://jaist.dl.sourceforge.net/project/pcre/pcre/8.36/pcre-8.36.tar.gz
4.下载http://cn2.php.net/distributions/php-5.6.2.tar.gz
5.下载http://mirror.bit.edu.cn/apache//httpd/httpd-2.4.10.tar.gz
6.下载http://nchc.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
7.安装apr
./configure –prefix=/pad/local/apr
make && make install
8.安装apr-util
./configure –prefix=/pad/local/apr-util -with-apr=/pad/local/apr/bin/apr-1-config
make && make install
9.安装pcre
./configure –prefix=/pad/local/pcre
make && make install
10.安装apache
./configure –prefix=/pad/local/apache –with-apr=/pad/local/apr –with-apr-util=/pad/local/apr-util/ –with-pcre=/pad/local/pcre
make && make install
11.安装libmcrypt
./configure –prefix=/pad/local/libmcrypt
make && make install
12.安装php
./configure –prefix=/pad/local/php -with-apxs2=/pad/local/apache/bin/apxs –with-curl –with-mcrypt=/pad/local/libmcrypt –enable-mbstring –with-iconv –with-gd -with-jpeg-dir=/usr/local/lib –enable-pdo –with-pdo-mysql=mysqlnd –with-mysqli=mysqlnd –with-mysql=mysqlnd
make && make install

13.复制php.ini文件
cp /pad/soft/php-5.6.2/php.ini-production /pad/local/php/lib/php.ini

vi /pad/local/php/lib/php.ini

把include_path前面的分号删除,改成include_path=”/pad/local/php/lib/php”

14.配置apache支持解析.php后缀文件
vi /pad/local/apache/conf/httpd.conf
在最下面加入一行AddHandler application/x-httpd-php .php

15.测试
vi /pad/local/apache/htdocs/phpinfo.php
phpinfo.php的内容如下:

16.访问
http://localhost/phpinfo.php

apache启动停止命令:
启动:/pad/local/apache/bin/apachectl start
停止:/pad/local/apache/bin/apachectl stop

友荐云推荐

关于开发者

开发者一枚...
此条目发表在linux分类目录,贴了, , , , , , , 标签。将固定链接加入收藏夹。

发表评论

电子邮件地址不会被公开。 必填项已用*标注