博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
LAMP架构四(PHP5.6的安装)
阅读量:2046 次
发布时间:2019-04-28

本文共 1521 字,大约阅读时间需要 5 分钟。

四、Linux 6 下编译安装 PHP 5.6实例详解

PHP(外文名:PHP: Hypertext Preprocessor,中文名:“超文本预处理器”)是一种通用开源脚本语言。语法吸收了C语言、Java和Perl的特点,利于学习,使用广泛,主要适用于Web开发领域。PHP以其开发源代码,免费,快捷,跨平台,高效,面向对象,强大的动态图像创建等功能深受广大开发者的喜爱。

1、下载php安装包

wget http://cn2.php.net/distributions/php-5.6.32.tar.bz2

2、安装,安装过程中可能需要依据提示不断的安装依赖包

# tar -jxvf php-5.6.32.tar.bz2 

# cd php-5.6.32

 

./configure --prefix=/usr/local/php --with-apxs2=/usr/sbin/apxs --with-config-file-path=/usr/local/php/etc --with-mysql   --with-pdo-mysql   --with-mysqli  --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif

报错处理:

Sorry, I cannot run apxs.  Possible reasons follow:

​1. Perl is not installed

​2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs

​3. Apache was not built using --enable-so (the apxs usage page is displayed)

​The output of /usr/local/apache/bin/apxs follows:./configure: line 6669: /usr/local/apache/bin/apxs: 

No such file or directoryconfigure: error: Aborting

解决方法:根据英文提示我们可以看到如下几点:perl没有安装,指定正确的apxs路径

于是进行如下操作

​#yum install -y perl* 

​#yum install -y httpd-devel

#find / -name apxs  得到的路径是:/usr/sbin/apxs

于是修改--with-apsx2=/usr/sbin/apxs指定到正确路径

最后正确执行

#make

#make test

#make install

如何查看安装完成?

httpd下新增了php模块

php需要service启动吗?

apache是利用apxs加载的模块,apxs 是一个为Apache HTTP服务器编译和安装扩展模块的工具,用于编译一个或多个源程序或目标代码文件为动态共享对象,使之可以用由mod_so 提供的LoadModule 指令在运行时加载到Apache服务器中。

顾php是apache的一个模块,不需要手动service启动。

转载地址:http://bclof.baihongyu.com/

你可能感兴趣的文章
【雅思】【作文】顾家北100句翻译
查看>>
【雅思】【写作】【大作文】Discuss both views and give your own opinion
查看>>
【托业】【金山词霸】21-42
查看>>
【托业】【金山词霸】单词1-20
查看>>
【托业】【新托业TOEIC新题型真题】学习笔记2-题库一-->P5-6
查看>>
【托业】【新托业TOEIC新题型真题】学习笔记1--题库一-->P1~4
查看>>
【JMeter】【微信好文收藏】Jmeter接口测试实战-有趣的cookie
查看>>
【Python】【面试必看】Python笔试题
查看>>
【Python】脚本运行报错:IndentationError: unindent does not match any outer indentation level...
查看>>
【JMeter】【接口测试】csv参数化,数据驱动,自动化测试
查看>>
【托业】【新托业TOEIC新题型真题】学习笔记13-题库四-P7
查看>>
【JMeter】JMeter如何输出测试报告
查看>>
【JMeter】【性能测试】响应信息不明确的接口做关联
查看>>
【接口】【面试题】http协议相关面试题
查看>>
【JMeter】【性能测试】正则表达式关联
查看>>
【JMeter】【性能测试】参数化,内存溢出问题
查看>>
【JMeter】接口自动化环境搭建
查看>>
【JMeter】插件安装
查看>>
【JMeter】【性能测试】服务器性能监控
查看>>
【Jmeter】if控制器+循环控制器+计数器,控制接口分支
查看>>