微慑信息网

Debian下安装apache+php

1、安装apr

tar -zxf apr-1.6.3.tar.gz
cd apr-1.6.3
./configure –prefix=/usr/local/apr
make && make install

出现:rm: cannot remove ‘libtoolT’: No such file or directory

解决:

直接打开 configure,把 $RM “$cfgfile” 那行删除掉,重新再运行 ./configure 就可以了。
找到 vi configure  大概在文件的最后部分找到如下: 注释掉  $RM “$cfgfile”  ,或者直接删除也可以, 然后重新运行./configure即可。

cfgfile=”${ofile}T”
trap “$RM \”$cfgfile\”; exit 1″ 1 2 15
$RM “$cfgfile”

cat <<_LT_EOF >> “$cfgfile”
#! $SHELL

2、安装apr-util

tar -zxjf apr-util-1.6.1.tar.bz2
cd apr-util-1.6.1
./configure –prefix=/usr/local/apr-util –with-apr=/usr/local/apr/bin/apr-1-config
make && make install

3、安装pcre

tar -xvjf pcre-8.4.2.tar.bz2
d pcre-8.4.2
./configure –prefix=/usr/local/pcre
make && make install
**最后编译Apache时加上:

–with-apr=/usr/local/apr \

–with-apr-util=/usr/local/apr-util/ \

–with-pcre=/usr/local/pcre

4.apache

configure: error: Size of “void *” is less than size of “long”

解决:增加参数 ap_cv_void_ptr_lt_long=no

(参考:https://blog.csdn.net/u013091013/article/details/76154842)

最终还没没能成功..改用Centos6.5 直接yum OK


中途各种问题,懒得整理了..:

http://blog.sina.com.cn/s/blog_404dab3b0102y3m1.html
https://www.linuxidc.com/Linux/2011-10/44565.htm
https://zgadzaj.com/how-to-install-php-53-and-52-together-on-ubuntu-1204
https://github.com/phpbrew/phpbrew

apt-get install apache2-dev
1.
debian apr
http://blog.sina.com.cn/s/blog_404dab3b0102y3m1.html
所用文件下载https://pan.baidu.com/s/10sAjh4qTiPDqbGogqqXmrA

操作全使用root权限
一、安装apr

tar -zxf apr-1.6.3.tar.gz
cd apr-1.6.3
./configure –prefix=/usr/local/apr
make && make install
二、安装apr-util

tar -zxjf apr-util-1.6.1.tar.bz2
cd apr-util-1.6.1
./configure –prefix=/usr/local/apr-util -with- apr=/usr/local/apr/bin/apr-1-config
make && make install
三、安装pcre

tar -xvjf pcre-8.4.2.tar.bz2
d pcre-8.4.2
./configure –prefix=/usr/local/pcre
make && make install
**最后编译Apache时加上:

–with-apr=/usr/local/apr \

–with-apr-util=/usr/local/apr-util/ \

–with-pcre=/usr/local/pcre

四、安装apache

1. 下载httpd-2.4.29.tar.bz2 源码安装包
2. #tar -xvjf httpd-2.4.29.tar.bz2
解压安装包,之后会出现 httpd-2.4.29 的文件夹,进入该文件夹。
3.进入文件后:
./configure –prefix=/usr/local//apache –with-apr=/usr/local/apr \

–with-apr-util=/usr/local/apr-util/ \

–with-pcre=/usr/local/pcre –enable-so

设置安装目录和参数设置
4. make
5. make install
6:/usr/local/apache/bin/apachectl start ,该命令用来启用apache。
7. /usr/local/apache/bin/apachectl stop
此时完成apache的安装

五、安装PHP

1.tar -xvjf php-5.6.36.tar.bz2

2. ./configure –prefix=/usr/local/php56 –with-apxs2=/usr/local/apache/bin/apxs

3. make

5.make install

最后注意:如果需要使用PHP环境,则在apache路径下的bin目录下设置httpd.conf文件,找到loadmodule如果没有加载php模块是不能使用PHP,大约150行如果没有加载加入:LoadModule php5_module modules/libphp5.so,默认是加载了的。另外,需要在httpd.conf的第388行后即:#add PHP Module插入两行:

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

这样apache就能解析html与php

(解压bunzip2 *.bz2 )

出现configure: error: no acceptable C compiler found in $PATH
没装gcc
解决 安装 gcc
./configure –prefix=/usr/local/apr-util –with-apr=/usr/local/apr/bin/apr-1-config

出现:
xml/apr_xml.c:35:19: fatal error: expat.h: No such file or directory
#include <expat.h>
^
compilation terminated.
make[1]: *** [xml/apr_xml.lo] Error 1
make[1]: Leaving directory `/home/test/apr-util-1.6.1′
make: *** [all-recursive] Error 1

解决:apt-get install libexpat1-dev (https://segmentfault.com/q/1010000009848251)

出现:Some packages could not be installed. This may mean that you have configure: error: C++ compiler cannot create execut

解决:apt-get install g++ (https://www.aliyun.com/zixun/content/3_12_513545.html)

./configure
出现:checking whether to enable mod_deflate… configure: error: mod_deflate has been requested but can not be built due to prerequisite failures
解决:apt-get install zlib1g-dev(http://blog.51cto.com/linuxme/971631)

make&&make install

./configure –prefix=/usr/local/apache2 –with-included-apr –enable-so –enable-deflate=shared –enable-expires=shared –enable-rewrite=shared –with-apr=/usr/local/apr –with-apr-util=/usr/local/apr-util/

(no us)–with-pcre=/usr/local/pcre

php编译:
出现:configure: error: libevent >= 1.4.11 could not be found

解决:apt-get install libevent-dev
apt-get install libxml2-dev

出现:configure: error: Cannot find OpenSSL’s <evp.h>
解决: apt-get install libcurl4-openssl-dev pkg-config libssl-dev

解决办法:

[email protected]:~/php-5.3.27# find / -name libssl.so

输出结果为: /usr/lib/x86_64-linux-gnu/libssl.so

初步判断它可能只会在 /usr/lib/ 下寻找 libssl.so 文件,于是:

ln -s /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib

重新编译安装即通过。
http://blog.51cto.com/linuxzj/1632132

php5.3.3

./configure –prefix=/usr/local/php –with-openssl=/usr –with-iconv-dir=/usr/local –enable-gd-native-ttf –with-libxml-dir –with-zlib –with-mhash –with-curl=/usr/local –with-curlwrappers –enable-bcmath –enable-calendar –enable-mbstring –enable-ftp –enable-zip –enable-sockets –enable-exif –enable-zend-multibyte –enable-fpm –with-fpm-user=root –with-fpm-group=root –with-apxs2=/usr/local/apache2/bin/apxs

apache

./configure –enable-so –prefix=/usr/local/apache2 –with-included-apr –enable-deflate=shared –enable-expires=shared –enable-rewrite=shared –with-apr=/usr/local/apr –with-apr-util=/usr/local/apr-util/ –with-pcre=/usr/local/pcre

本文标题:Debian下安装apache+php
本文链接:
(转载请附上本文链接)
http://vulsee.com/archives/vulsee_2018/1128_7143.html
转载请附本站链接,未经允许不得转载,,谢谢:微慑信息网-VulSee.com » Debian下安装apache+php
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

微慑信息网 专注工匠精神

访问我们联系我们