不能在OS X 10.9 Mavericks中进行phpize或配置扩展吗?

时间:2021-09-04 20:52:33

I am trying to build the memcached extension on OS X 10.9 Mavericks for use with the built in PHP 5.4, initially I tried pecl install memcached but that threw the following.

我正在尝试在OS X 10.9 Mavericks上构建memcached扩展,以供在PHP 5.4中使用,最初我尝试了pecl安装memcached,但这导致了下面的内容。

checking for zlib location... configure: error: memcached support requires ZLIB. Use --with-zlib-dir=<DIR> to specify the prefix where ZLIB headers and library are located
ERROR: `/private/tmp/pear/install/memcached/configure' failed

So I created a tmp directory and executed pecl download memcached, unzipped the code and cd'd to the appropriate directory.

因此,我创建了一个tmp目录并执行pecl下载memcached,将代码和cd解压缩到适当的目录。

Trying to phpize it returned the following:

试着对它进行phpize返回:

grep: /usr/include/php/main/php.h: No such file or directory
grep: /usr/include/php/Zend/zend_modules.h: No such file or directory
grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:        
Zend Module Api No:     
Zend Extension Api No:  

I had brew installed zlib a while ago and pointed ./configure at my installation. ./configure --with-zlib-dir=/usr/local/Cellar/zlib/1.2.8 I was greeted with the following error message:

我在一段时间之前就已经安装了zlib,并在我的安装上进行了配置。/配置——使用-zlib-dir=/usr/local/地下室/zlib/1.2.8,我收到了如下错误信息:

checking for session includes... configure: error: Cannot find php_session.h

So now I'm wondering the best course of action here... /usr/include/ doesn't exist at all... is this a Mavericks thing? I don't remember having this problem in 10.8 at all.

所以现在我想知道这里的最佳做法是什么……/usr/include/根本不存在……这是小牛队的事吗?我不记得10.8有这个问题。

I could try brew installing php-devel but I presume that isn't going to be the right version of what I need? Any help would be greatly appreciated here

我可以尝试安装php-devel,但我认为这不是我所需要的正确版本吗?这里非常感谢您的帮助。

Update

locate php_session.h reveals

定位php_session。h揭示了

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/php/ext/session/php_session.h

/应用程序/ xcode /内容/开发/平台/ MacOSX.platform /开发/ sdk / MacOSX10.8.sdk / usr / include / php / ext /会议/ php_session.h

should I just ln -s this to the expected location or is there some way to do this via XCode? I have the command line tools installed...

我应该把它放到期望的位置还是通过XCode来实现?我安装了命令行工具…

4 个解决方案

#1


97  

run xcode-select --install to install the XCode5 Command Line Tools, then sudo pecl install memcache. You should be good to go.

运行xcode-select——安装XCode5命令行工具,然后sudo pecl安装memcache。你该走了。

#2


5  

After install XCode5 Command Line Tools as afessler sugest (xcode-select --install) I couldn't do the "sudo pecl install memcache" because pecl was missing. I had to install PEAR and PECL following this guide: http://techtastico.com/post/como-instalar-pear-y-pecl-en-os-x-mavericks/. Then all worked good. Thanks!

在将XCode5命令行工具安装为afessler sugest (xcode-select—install)之后,我无法完成“sudo pecl安装memcache”,因为pecl丢失了。我必须安装PEAR和PECL来遵循这一指南:http://techtastico.com/post/como-instalar- pearl - PECL -en-os-x-mavericks/。那么好的工作。谢谢!

#3


3  

I had this problem and it was due to MAMP not having all the PHP sources.

我遇到了这个问题,这是由于MAMP没有所有PHP源。

I found this really helpful solution that explains how to download and configure them: https://*.com/a/11175197/369326

我发现了一个非常有用的解决方案,它解释了如何下载和配置它们:https://*.com/a/11175197/369326。

Note that the MAMP components doesn't include the extras for any versions of PHP higher than php 5.4.10 but you can download the extras from http://php.net/releases.

请注意,MAMP组件不包含任何PHP版本的附加组件,但您可以从http://php.net/release下载这些附加组件。

#4


0  

As said above but not using xcode install Try installing pecl manually:

如上所述,但不使用xcode安装尝试手动安装pecl:

  curl -O http://pear.php.net/go-pear.phar 
  sudo php -d detect_unicode=0 go-pear.phar 

and then:

然后:

 sudo pecl install memcache

See more at: http://jason.pureconcepts.net/2012/10/install-pear-pecl-mac-os-x/#sthash.x2LKdqj6.dpuf

多见于:http://jason.pureconcepts.net/2012/10/install-pear-pecl-mac-os-x/ # sthash.x2LKdqj6.dpuf

#1


97  

run xcode-select --install to install the XCode5 Command Line Tools, then sudo pecl install memcache. You should be good to go.

运行xcode-select——安装XCode5命令行工具,然后sudo pecl安装memcache。你该走了。

#2


5  

After install XCode5 Command Line Tools as afessler sugest (xcode-select --install) I couldn't do the "sudo pecl install memcache" because pecl was missing. I had to install PEAR and PECL following this guide: http://techtastico.com/post/como-instalar-pear-y-pecl-en-os-x-mavericks/. Then all worked good. Thanks!

在将XCode5命令行工具安装为afessler sugest (xcode-select—install)之后,我无法完成“sudo pecl安装memcache”,因为pecl丢失了。我必须安装PEAR和PECL来遵循这一指南:http://techtastico.com/post/como-instalar- pearl - PECL -en-os-x-mavericks/。那么好的工作。谢谢!

#3


3  

I had this problem and it was due to MAMP not having all the PHP sources.

我遇到了这个问题,这是由于MAMP没有所有PHP源。

I found this really helpful solution that explains how to download and configure them: https://*.com/a/11175197/369326

我发现了一个非常有用的解决方案,它解释了如何下载和配置它们:https://*.com/a/11175197/369326。

Note that the MAMP components doesn't include the extras for any versions of PHP higher than php 5.4.10 but you can download the extras from http://php.net/releases.

请注意,MAMP组件不包含任何PHP版本的附加组件,但您可以从http://php.net/release下载这些附加组件。

#4


0  

As said above but not using xcode install Try installing pecl manually:

如上所述,但不使用xcode安装尝试手动安装pecl:

  curl -O http://pear.php.net/go-pear.phar 
  sudo php -d detect_unicode=0 go-pear.phar 

and then:

然后:

 sudo pecl install memcache

See more at: http://jason.pureconcepts.net/2012/10/install-pear-pecl-mac-os-x/#sthash.x2LKdqj6.dpuf

多见于:http://jason.pureconcepts.net/2012/10/install-pear-pecl-mac-os-x/ # sthash.x2LKdqj6.dpuf