如何在phpfarm php安装上安装pthreads [英] How to install pthreads on a phpfarm php installation
问题描述
命令 pecl install pthreads
失败,原因是在我的 ubuntu 13.04
框中安装的php没有配置zts。
The command pecl install pthreads
fails due to the php installed on my ubuntu 13.04
box not having zts configured.
选项:
1)ubuntu存储库没有php软件包启用zts。截至本文发布时,ubuntu的存储库中仅包含PHP 5.4.9(已发布:2012年11月22日)。可以从源代码编译php版本-我最终做到了(见下文),但是..
1) The ubuntu respository does not have a php package with zts enabled. As of this post, ubuntu only has php 5.4.9 in it's repository (Released: 22 Nov 2012). It is possible to compile a php version from source - which I eventually did (see below), but..
2)我.. ALSO ..想使用phpfarm来在我的本地设置上运行不同版本的PHP的能力。在github上,这里有Christian Weiske的原始贡献( phpfarm )和他贡献的叉子,由FrançoisPoirotte撰写-也称为 phpfarm 。 Francois的fork有更多配置选项(安装后自定义),但我无法通过PECL扩展程序使它起作用。我想知道是否被误解了,因为在我看来,它只是不接受PECL命令。
2) I .. ALSO .. wanted to use phpfarm for the ability to run different versions of PHP on my local setup. On github, there is Christian Weiske's original contribution here (phpfarm) and a fork that he has contributed to, by François Poirotte - also called phpfarm. Francois' fork has a few more options to configure ('post-install customization') but I was not able to make that work with a PECL extension. I'm curious to know if misunderstood how to do that, because it looks to me that it just simply does not take PECL commands.
3)。在从源代码重新编译php之前,我加载了phpfarm(尝试了两个版本),启用了php-fpm(FastCGI),并且能够使我的apache2服务器使用phpfarm版本(5.5.10),该版本显示在phpinfo()输出中。但是php-cli总是在cli中显示原始php版本(5.4.9)(运行:php -v)。运行(运行:php -i | grep php.ini)显示为/ etc / php5 / cli,但是我之前已删除了php5,并且 pecl install pthreads
,然后使用pthreads重新编译phpfarm 5.5.10版本已启用。尽管看来我将能够在apache服务器中运行各种版本的php,但我是否能够将phpfarm切换到另一个版本,并在php-cli中看到它正常工作?另外,我不确定在哪里可以为phpfarm编译过程加载pthreads文件来查找和使用它。我能那样做吗?
3). Prior to recompiling php from source, I loaded phpfarm (tried both versions), enabled php-fpm (FastCGI) and was able to get my apache2 server to use a phpfarm version (5.5.10) which showed up in a phpinfo() output. But the php-cli always showed the original php version (5.4.9) in the cli (run: php -v). Running (run: php -i | grep php.ini) showed /etc/php5/cli but I had previously removed php5 and aptitude show php5
returned a state of 'not installed.' I even renamed the /etc/php5 directory to see if I could force the system to use the phpfarm php version. Obviously, this is incorrect thinking and I went on to simply compile php 5.6 from source. But, is there something more to do to get a phpfarm php to be used in the cli? I read that the cli loads it's configuration file on a per command basis, unlike the apache2. If I could have run the 5.5.10 version (configured with zts) then I could have then done pecl install pthreads
and then re-complied the phpfarm 5.5.10 version with pthreads enabled. Although it appears I will be able to run various versions of php in the apache server, will I ever be able to switch-phpfarm to another version and see it working in the php-cli? Also, I was uncertain on where I could have loaded a pthreads file for the phpfarm compile process to find and use it; could I have done it that way?
4)这个 stackoverflow帖子,基本上由Joe Watkins( pThreads 是将pThreads安装在已配置了zts的php的Ubuntu系统上的完美方法(Zend Thread Safety)。 (谢谢乔!)
4) This stackoverflow post, essentially posted by Joe Watkins - the developer of pThreads is a perfect how-to on getting pThreads installed on a Ubuntu system that has had php configured with zts (Zend Thread Safety). (Thanks Joe!)
一个不错的选择教程使用配置了fast-cgi的phpfarm和apache服务器来帮助在不同的php配置下运行网站。
A nice tutorial on using phpfarm configured with fast-cgi and the apache server to help run websites under different php configurations.
那么php-php-cli有什么用呢?和phpfarm?
So what gives with php, php-cli and the phpfarm?
推荐答案
我不确定phpfarm,但是知道其他解决方案...
I'm not sure about phpfarm, but do know of another solution ...
用于维护多种配置的PHP多次安装的工具
https://github.com/datingvip/multi
这是面向用户的一点,它将允许您构建php的许多配置和版本,任何标记的php版本以及任何来自php-src分支的修补版本。
This is a bit more user orientated, will allow you to build many configurations and versions of php, any tagged release of php, and any patched version from any fork of php-src.
此外,因为我写了它,它将为您安装pthreads。
In addition, because I wrote it, it will install pthreads for you.
git clone https://github.com/datingvip/multi
cd multi
VERSION=5.5.10 DBG=no-debug ZTS=zts ./php.multi
以上命令将在/ opt / php中安装PHP(以一种合适的配置,一种版本)。
The above commands will yield an installation of PHP (in one suitable configuration, of one version) in /opt/php.
查看 php.defaults
进行配置选项并在构建之前进行调整
Look at php.defaults
for configuration options and adjust before building
如果配置失败,例如与libxml2之类的库相关的东西,通常是
Should configuration fail on, for example, something related to a library like libxml2, it will usually be the case that
sudo apt-get install library-dev
将库替换为持有构建的库的名称,将为您解决问题。如果没有,那么快速的Google应该会让您再次尝试。
Where library is replaced with the name of the library holding up the build, will fix the problem for you. If it does not, a quick google should get you going again.
构建完成后
source /path/to/multi/php.env 5.5.10
注意:multi会始终自动为任何zts版本安装pthreads
我希望您能找到一个...
I hope that gets you somewhere ...
这篇关于如何在phpfarm php安装上安装pthreads的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!