首页 技术 正文
技术 2022年11月8日
0 收藏 807 点赞 1,533 浏览 2389 个字

安装准备: http://ftp.cuhk.edu.hk/pub/packages/apache.org//httpd/httpd-2.4.23.tar.gz 下载apachehttp://cn2.php.net/distributions/php-7.1.0.tar.gz 下载php7.1http://archive.apache.org/dist/apr/apr-1.5.0.tar.gz 下载apr

http://archive.apache.org/dist/apr/apr-util-1.5.4.tar.gz 下载apr-util

http://jaist.dl.sourceforge.net/project/pcre/pcre/8.39/pcre-8.39.tar.gz  下载pcre注意事项:wget  vim   gcc gcc-c++   cmake  这几个也是安装 Apache 所需要的小环境 。  yum -y install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel mysql pcre-devel curl-devel  libxslt-devel yum install gcc-c++ gcc 首先安装apr先解压(略)./configure –prefix=/usr/local/apr/make && make install 安装apr-util (PS:注意先后顺序)

先解压(略)

 ./configure –prefix=/usr/local/apr-util/ –with-apr=/usr/local/apr/  

make && make install

 安装pcre

先解压(略)

  ./configure –prefix=/usr/local/pcre/  
make && make install 然后安装apache

先解压(略)

 ./configure –prefix=/usr/local/apache/ –with-apr=/usr/local/apr/ –with-apr-util=/usr/local/apr-util/ –with-pcre=/usr/local/pcre/  make && make install 安装完成 测试apache cd /usr/local/apache/bin/  ./apachectl start   启动apache 成功显示 It Works!就代表 服务器已成功!添加Apache到Linux服务

cp /usr/local/apache/bin/apachectl  /etc/rc.d/init.d/

mv /etc/rc.d/init.d/apachectl /etc/rc.d/init.d/httpd

chkconfig –add httpd  #所有开机模式下自启动

chkconfig httpd on  #345开机模式下自启动

安装php7
先解压(略)./configure –prefix=/usr/local/php –with-apxs2=/usr/local/apache/bin/apxs  –with-curl  –with-freetype-dir  –with-gd  –with-gettext  –with-iconv-dir  –with-kerberos  –with-libdir=lib64  –with-libxml-dir  –with-mysqli  –with-openssl  –with-pcre-regex  –with-pdo-mysql  –with-pdo-sqlite  –with-pear  –with-png-dir  –with-xmlrpc  –with-xsl  –with-zlib  –enable-fpm  –enable-bcmath  –enable-libxml  –enable-inline-optimization  –enable-gd-native-ttf  –enable-mbregex  –enable-mbstring  –enable-opcache  –enable-pcntl  –enable-shmop  –enable-soap  –enable-sockets  –enable-sysvsem  –enable-xml  –enable-zip 

出现“/replace/with/path/to/perl/interpreter: bad interpreter: No such file or

#vi  /usr/local/apache/bin/apxs

第一行的#!/replace/with/path/to/perl/interpreter -w,找到你perl的安装位置,如果不清楚,可以用which perl找到,一般在/usr/bin/perl ,于是将第一行改为:#!/usr/bin/perl -w. 再运行php的configure, 一切正常!

 make && make install  安装完成后打开httpd.conf  查找php7

看是否搜索到:LoadModule php7_module modules/libphp7.so

如果没有搜索到(一般都是可以搜索到的),就将这段指令添加到httpd.conf配置文件中,使apache可以加载libphp7.so模块,并进行php文件的解析。

:wq

进行保存退出。

cd  /usr/local/apache/htdocs

按 i 键进入编辑模式,添加:

<?php

phpinfo();

?>

按Esc键回到命令模式,保存退出:

:wq

centos 7.2 安装PHP7.1+apache2.4.23

centos 7.2 安装PHP7.1+apache2.4.23

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,493
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,907
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,740
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,495
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,133
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,297