试图将MAMP 3.4与最新版本的PHP(5.6.10)结合使用,但是我需要PHP扩展GMP.我的理解是,该扩展不是一个单独的模块,而是需要使用–with-gmp完全重新编译PHP.

尝试使用干净的5.6.10源代码遵循the guide linked here,但OP遇到相同的错误:

Didiers-MacBook-Pro:php-5.6.10 didier$./configure --with-mysql=/Applications/MAMP/Library --with-apxs2=/Applications/MAMP/Library/bin/apxs --with-gd --with-jpeg-dir=/Applications/MAMP/Library --with-png-dir=/Applications/MAMP/Library --with-zlib --with-freetype-dir=/Applications/MAMP/Library --prefix=/Applications/MAMP/bin/php5 --exec-prefix=/Applications/MAMP/bin/php5 --sysconfdir=/Applications/MAMP/conf/php5 --with-soap --with-config-file-path=/Applications/MAMP/conf/php5 --enable-track-vars --enable-bcmath --enable-ftp --enable-gd-native-ttf --with-bz2=/usr --with-ldap --with-mysqli=/Applications/MAMP/Library/bin/mysql_config --with-sqlite --with-ttf --with-t1lib=/Applications/MAMP/Library --enable-mbstring=all --with-curl=/Applications/MAMP/Library --enable-dbx --enable-sockets --enable-bcmath --with-imap=shared,/Applications/MAMP/Library/lib/imap-2006i --enable-soap --with-kerberos --enable-calendar --with-pgsql=shared,/Applications/MAMP/Library/pg --enable-dbase --enable-exif --with-libxml-dir=/Applications/MAMP/Library --with-gettext=shared,/Applications/MAMP/Library --with-xsl=/Applications/MAMP/Library --with-pdo-mysql=/Applications/MAMP/Library --with-pdo-pgsql=shared,/Applications/MAMP/Library/pg --with-mcrypt=shared,/Applications/MAMP/Library --with-openssl --with-gmp --without-iconv --prefix=/Users/Didier/Desktop/result

configure: WARNING: unrecognized options: --with-soap, --enable-track-vars, --with-sqlite, --with-ttf, --enable-dbx, --enable-dbase

checking for grep that handles long lines and -e... /usr/bin/grep

checking for egrep... /usr/bin/grep -E

checking for a sed that does not truncate output... /usr/bin/sed

checking build system type... x86_64-apple-darwin14.5.0

checking host system type... x86_64-apple-darwin14.5.0

checking target system type... x86_64-apple-darwin14.5.0

checking for cc... cc

checking whether the C compiler works... yes

checking for C compiler default output file name... a.out

checking for suffix of executables...

checking whether we are cross compiling... no

checking for suffix of object files... o

checking whether we are using the GNU C compiler... yes

checking whether cc accepts -g... yes

checking for cc option to accept ISO C89... none needed

checking how to run the C preprocessor... cc -E

checking for icc... no

checking for suncc... no

checking whether cc understands -c and -o together... yes

checking how to run the C preprocessor... cc -E

checking for ANSI C header files... yes

checking for sys/types.h... yes

checking for sys/stat.h... yes

checking for stdlib.h... yes

checking for string.h... yes

checking for memory.h... yes

checking for strings.h... yes

checking for inttypes.h... yes

checking for stdint.h... yes

checking for unistd.h... yes

checking minix/config.h usability... no

checking minix/config.h presence... no

checking for minix/config.h... no

checking whether it is safe to define __EXTENSIONS__... yes

checking whether ln -s works... yes

checking for system library directory... lib

checking whether to enable runpaths... yes

checking if compiler supports -R... no

checking if compiler supports -Wl,-rpath,... yes

checking for gawk... no

checking for nawk... no

checking for awk... awk

checking if awk is broken... no

checking for bison... bison -y

checking for bison version... invalid

configure: WARNING: This bison version is not supported for regeneration of the Zend/PHP parsers (found: 2.3, min: 204, excluded: 3.0).

checking for re2c... no

configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.

checking whether to enable computed goto gcc extension with re2c... no

checking whether cc supports -no-cpp-precomp... yes

checking whether to force non-PIC code in shared modules... no

checking whether /dev/urandom exists... yes

checking for pthreads_cflags...

checking for pthreads_lib...

Configuring SAPI modules

checking for AOLserver support... no

checking for Apache 1.x module support via DSO through APXS... no

checking for Apache 1.x module support... no

checking whether to enable Apache charset compatibility option... no

checking for Apache 2.0 filter-module support via DSO through APXS... no

checking for Apache 2.0 handler-module support via DSO through APXS...

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 /Applications/MAMP/Library/bin/apxs follows:

cannot open /Applications/MAMP/Library/build/config_vars.mk: No such file or directory at /Applications/MAMP/Library/bin/apxs line 217.

configure: error: Aborting

解决方法:

原来,您需要来自httpd的一些关键文件才能将php构建为Apache模块(如MAMP所要求). MAMP会从安装中忽略那些文件.

>从http://mirror.reverse.net/pub/apache/httpd/下载Apache

确保您下载的版本与MAMP发行版中的版本相同.您可以从命令行键入/ Applications / MAMP / Library / bin / httpd -version来查找.

>解压发行版并CD进入.

>在某处放置一个文件夹以存储构建结果.我们会将文件放在〜/ Desktop / build / httpd之类的桌面上.

>下一步是构建httpd.像./configure –prefix = / Users / [用户名] / Desktop / build / httpd –enable这样的东西应该可以解决.请注意,安装路径必须是绝对路径,因此我们不能在此处使用波浪号字符.

>一旦配置完成且没有任何错误,请进行安装.您现在拥有了从源代码编译的Apache服务器.恭喜!

>从该版本中,我们需要获取MAMP安装中缺少的文件.这实际上是一个位于〜/ Desktop / build / httpd / build的目录.将其复制到/ Applications / MAMP / Library中,您现在就可以构建PHP,而不会出现上述错误消息.确保复制目录并且不要移动它.稍后在PHP编译期间将需要它.

下一步是编译PHP本身:

>从http://php.net/downloads.php下载PHP源代码.

确保下载的是您要替换的相同版本(您可以在/ Applications / MAMP / bin / php中找到MAMP存储的所有版本.在我的情况下,我正在构建5.6.10.

>解压发行版并CD进入.

>在某处放置一个文件夹以存储构建结果.我再次将结果放在〜/ Desktop / build / php中的桌面上.

>配置PHP以使用./configure –with-apxs2 = / Applications / MAMP / Library / bin / apxs –prefix = / Users / [用户名] / Desktop / build / php –with-构建所需的内容openssl –without-iconv.如果您愿意,可以查看现有的phpinfo页面以了解要替换的版本,以了解其编译时所用的版本.请记住,某些模块将要求您从其他一些库的源副本中构建.

>进行安装.

>您现在有了一个可与MAMP一起使用的php共享对象.关闭MAMP,将〜/ Dekstop / build / httpd / modules / libphp5.so复制到/Applications/MAMP/bin/php/php5.6.10/modules并重新启动.保留以前的libphp5.so文件的副本并不是一个坏主意,以防万一.

标签:gmp,mamp,php

来源: https://codeday.me/bug/20191119/2037881.html

mamp安装php扩展,向MAMP添加GMP PHP扩展相关推荐

  1. mamp 安装php,php – 在MAMP上安装Laravel

    我从 Github下载了 latest version of Laravel,解压缩它,然后将它放在MAMP中的htdocs文件夹中. MAMP运行PHP版本5.4.10,因此符合Laravel对PH ...

  2. MAMP安装pcntl扩展(其他扩展同理)

    使用mac开发,mamp是比较好用的一套集成环境.其中包含了各个版本的配置选择.但是里面的自带的php很多扩展没有安装,需要自己手动添加.这里主要介绍安装pcntl扩展. 1.下载和你mamp所有的P ...

  3. macosx php环境,MacOSX环境下MAMP安装配置PHP的开发环境

    本部分描述如何在 Mac 上安装 MAMP.将通过一个操作安装 Apache Web 服务器.MySQL 和phpMyAdmin,需要的朋友可以参考下 一.简单介绍: PHP 页需要通过 Web 服务 ...

  4. mamp 配置php,Mac OSX下使用MAMP安装配置PHP开发环境

    一.简单介绍: PHP 页需要通过 Web 服务器处理.因此,要在 PHP 进行开发,您需要访问支持 PHP 的 Web 服务器和 MySQL 数据库.phpMyAdmin 也很实用,它是 MySQL ...

  5. Chrome浏览器安装插件时报错“无法从该网站添加应用、扩展程序和用户脚本”解决办法

    在使用Chrome浏览器,安装插件的时候会出现"无法从该网站添加应用.扩展程序和用户脚本" 解决方法如下 第一步:首先添加一个新的标签页,输入:chrome://flags/#ex ...

  6. 扩展LLVM:添加指令、内部函数、类型等

    扩展LLVM:添加指令.内部函数.类型等 Introduction and Warning Adding a new intrinsic function Adding a new instructi ...

  7. 台式电脑计算机能创建新磁盘吗,解决方案:如何添加硬盘以扩展台式计算机上的存储空间|如何对新添加的硬盘进行分区...

    ‍ 如果是家用计算机,许会选择台式计算机.随着使用期间存储量的不断增加,计算机系统中的可用空间也越来越少.在这种情况下,您可以在计算机上添加硬盘以扩展系统的磁盘容量.下面介绍如何向桌面添加硬盘驱动器以 ...

  8. 为PHP添加swoole异步并行扩展

    为PHP添加swoole异步并行扩展 1. 确认安装环境 仅支持Linux操作系统,核心代码兼容FreeBSD,需要调整某些编译的参数和细节才能通过 Linux内核版本2.3.32以上 PHP5.3. ...

  9. 安装VS2003时IIS下面缺少FrontPage2000服务器扩展的解决办法

    安装VS2003时IIS下面缺少FrontPage2000服务器扩展的解决办法 IIS安装完后,一直没找到如何安装Frontpage扩展,导致ASP.net无法使用,通过修改inf文件来完成.方法如下 ...

最新文章

  1. python web server comparison
  2. Entityframework:“System.Data.Entity.Internal.AppConfig”的类型初始值设定项引发异常。
  3. Vue.js 学习笔记 第5章 内置指令
  4. 关于SafeMove White Paper功能
  5. iOS自动布局进阶用法
  6. python面试技巧和注意事项_Python 程序员面试须知须会的5个问题
  7. 开发经常犯的错误之→【join表连接关联查询 】
  8. IBM服务器诊断面板
  9. 什么是Symbian
  10. 数据库课设——企业员工人事管理系统
  11. OpenShift——openshift 3.11 集群安装(亲测版,你懂的)
  12. android通知栏点击关闭,Android点击通知栏 ,移除通知
  13. CVPR 2022 Oral | MLP进军底层视觉!谷歌提出MAXIM:刷榜多个图像处理任务,代码已开源!...
  14. Sorry, The number you dialed is power off.
  15. 解决Windows时间同步失败问题!系统时间同步设置!
  16. Unity2D平台开发
  17. iOS 关于ASIHTTPRequest
  18. HDU - 1284 钱币兑换问题 (找规律/完全背包)
  19. 90 个名企笔试题和算法题
  20. 【2011红领巾系列——网站/域名】

热门文章

  1. C++STL笔记(三):array详解
  2. oracle10g em 产生log,如何创建Oracle10G EM dbcontrol
  3. mysql parameters_MySqlCommand Command.Parameters.Add已过时?mysql-问答-阿里云开发者社区-阿里云...
  4. ios 重复引用 静态库_Swift 制作静态库
  5. java 双等于 equals_在Java中等于equals vs Arrays.equals
  6. cubrid php,PHP - Manual: CUBRID (官方文档)
  7. java signutil_java.util包 上
  8. mysql jdbc实例_jdbc操作mysql数据库实例
  9. 3500x架构_如何评价超威半导体(AMD)新发布的 锐龙(Ryzen)3500X?
  10. java创建response对象_javaweb入门-----request与response的作用