Welcome! Log In Create A New Profile

Advanced

What's the right way to get FPM?

Posted by 任晓磊 
任晓磊
What's the right way to get FPM?
May 04, 2010 04:34AM
I tried
svn co svn co http://svn.php.net/repository/php/php-src/trunk
and got a 5.3.99 php with fpm. XCache cannot compile with this version.

Is it the right way to fetch the regular php 5.3.2 plus
svn co http://svn.php.net/repository/php/php-src/trunk/sapi/fpm
and compile them together?

--
Ren Xiaolei
Re: What's the right way to get FPM?
May 04, 2010 12:02PM
On Tue, May 4, 2010 at 1:32 AM, 任晓磊 <julyclyde@gmail.com> wrote:

> I tried
> svn co svn co http://svn.php.net/repository/php/php-src/trunk
> and got a 5.3.99 php with fpm. XCache cannot compile with this version.

probably unstable due to php itself being unstable/bleeding edge in trunk

> Is it the right way to fetch the regular php 5.3.2 plus
> svn co http://svn.php.net/repository/php/php-src/trunk/sapi/fpm
> and compile them together?

yes :)
http://php-fpm.org/download/

fpm doesn't have as many changes to it as php does. people seem to be
running it without too many issues even though it's not "officially
stable" and in a stable PHP build yet.
Matthew Barr
Re: What's the right way to get FPM?
May 04, 2010 05:32PM
Has anyone been able to build using SRPMS / Spec files for RHEL/Centos 5? I'm using fedora upstream spec files from Remi Collet http://rpms.famillecollet.com/. He's one of the Fedora PHP maintainers. I'm running into the issue that the spec file builds multiple copies of PHP, for apache, for cli, for embedded, etc. It does that by dropping into different subdirectories to build things.

PHP-FPM doesn't like that at all. I get the errors that other folks have seen trying to build in subdirs:

/usr/src/redhat/BUILD/php-5.3.2/build-cgi/libtool: line 1266: sapi/fpm/fpm/fastcgi.loT: No such file or directory
mkdir: cannot create directory `sapi/fpm/fpm/.libs': No such file or directory


I"m going to try a straight build, but I'd really like to figure out which part of the makefile & config snippets are breaking the build, so we can just have a nice single spec file to package things.

Matthew
任晓磊
Re: What's the right way to get FPM?
May 04, 2010 09:28PM
On Wed, May 5, 2010 at 12:00 AM, Michael Shadle <mike503@gmail.com> wrote:
>> Is it the right way to fetch the regular php 5.3.2 plus
>> svn co http://svn.php.net/repository/php/php-src/trunk/sapi/fpm
>> and compile them together?
>
> yes :)
> http://php-fpm.org/download/
>
> fpm doesn't have as many changes to it as php does. people seem to be
> running it without too many issues even though it's not "officially
> stable" and in a stable PHP build yet.

So, even fpm is in SVN, it works like a PHP extension?

--
Ren Xiaolei
Re: What's the right way to get FPM?
May 04, 2010 11:22PM
at the moment since it is not in 5_3 and only in trunk, you have to
get it separately. it is a sapi though, not an extension. however
since it is separate, i guess it can be thought of as one for the time
being. but no more than --enable-fastcgi or anything like that
otherwise.

On Tue, May 4, 2010 at 6:27 PM, 任晓磊 <julyclyde@gmail.com> wrote:
> On Wed, May 5, 2010 at 12:00 AM, Michael Shadle <mike503@gmail.com> wrote:
>>> Is it the right way to fetch the regular php 5.3.2 plus
>>> svn co http://svn.php.net/repository/php/php-src/trunk/sapi/fpm
>>> and compile them together?
>>
>> yes :)
>> http://php-fpm.org/download/
>>
>> fpm doesn't have as many changes to it as php does. people seem to be
>> running it without too many issues even though it's not "officially
>> stable" and in a stable PHP build yet.
>
> So, even fpm is in SVN, it works like a PHP extension?
>
> --
> Ren Xiaolei
>
Matthew Barr
PHP-FPM & RHEL Specs, or building in subdirectories?
May 12, 2010 11:18AM
(This is a repost, because I don't think anyone actually saw this. It was deep in a thread, vs it's own new thread.)

Has anyone been able to build using SRPMS / Spec files for RHEL/Centos 5? I'm using fedora upstream spec files from Remi Collet http://rpms.famillecollet.com/. He's one of the Fedora PHP maintainers. I'm running into the issue that the spec file builds multiple copies of PHP, for apache, for cli, for embedded, etc. It does that by dropping into different subdirectories to build things.

PHP-FPM doesn't like that at all. I get the errors that other folks have seen trying to build in subdirs:

/usr/src/redhat/BUILD/php-5.3.2/build-cgi/libtool: line 1266: sapi/fpm/fpm/fastcgi.loT: No such file or directory
mkdir: cannot create directory `sapi/fpm/fpm/.libs': No such file or directory


I"m going to try a straight build, but I'd really like to figure out which part of the makefile & config snippets are breaking the build, so we can just have a nice single spec file to package things.

Matthew
Jérôme Loyet
Re: PHP-FPM & RHEL Specs, or building in subdirectories?
May 12, 2010 12:08PM
Can you provide de source of the SPEC file ?

2010/5/12 Matthew Barr <mbarr@interactiveone.com>

> (This is a repost, because I don't think anyone actually saw this. It was
> deep in a thread, vs it's own new thread.)
>
> Has anyone been able to build using SRPMS / Spec files for RHEL/Centos 5?
> I'm using fedora upstream spec files from Remi Collet <
> http://rpms.famillecollet.com/>. He's one of the Fedora PHP maintainers.
> I'm running into the issue that the spec file builds multiple copies of PHP,
> for apache, for cli, for embedded, etc. It does that by dropping into
> different subdirectories to build things.
>
> PHP-FPM doesn't like that at all. I get the errors that other folks have
> seen trying to build in subdirs:
>
> /usr/src/redhat/BUILD/php-5.3.2/build-cgi/libtool: line 1266:
> sapi/fpm/fpm/fastcgi.loT: No such file or directory
> mkdir: cannot create directory `sapi/fpm/fpm/.libs': No such file or
> directory
>
>
> I"m going to try a straight build, but I'd really like to figure out which
> part of the makefile & config snippets are breaking the build, so we can
> just have a nice single spec file to package things.
>
> Matthew
>
>
>
>
>
>
>
>
>
Re: PHP-FPM & RHEL Specs, or building in subdirectories?
May 12, 2010 12:15PM
Matthew Barr Wrote:
-------------------------------------------------------
> (This is a repost, because I don't think anyone
> actually saw this. It was deep in a thread, vs
> it's own new thread.)
>
> Has anyone been able to build using SRPMS / Spec
> files for RHEL/Centos 5? I'm using fedora
> upstream spec files from Remi Collet . He's one of
> the Fedora PHP maintainers. I'm running into the
> issue that the spec file builds multiple copies of
> PHP, for apache, for cli, for embedded, etc. It
> does that by dropping into different
> subdirectories to build things.
>
> PHP-FPM doesn't like that at all. I get the
> errors that other folks have seen trying to build
> in subdirs:
>
> /usr/src/redhat/BUILD/php-5.3.2/build-cgi/libtool:
> line 1266: sapi/fpm/fpm/fastcgi.loT: No such file
> or directory
> mkdir: cannot create directory
> `sapi/fpm/fpm/.libs': No such file or directory
>
>
> I"m going to try a straight build, but I'd really
> like to figure out which part of the makefile &
> config snippets are breaking the build, so we can
> just have a nice single spec file to package
> things.
>
> Matthew

I saw the error when I made my ubuntu debian package which also builds the different SAPIs in subdirectories. I added an extra line

-mkdir fpm-build/sapi/fpm/fpm

into the configure step of the debian/rules file, which I assume is like your spec file for rpms. That was the only glitch I ran into.
On May 12, 2010, at 12:06 PM, Jérôme Loyet wrote:

> Can you provide de source of the SPEC file ?


http://github.com/remicollet/remirepo/blob/master/php/php.spec


I just tried using Brian's suggestion:

-mkdir fpm-build/sapi/fpm/fpm (also tried --mkdir fpm-build/sapi/fpm/fpm, to eliminate the possibility of the typo.)

but that didn't work, failing to be recognized by the configure script. I had looked inside the configure script in the past, and only saw the following options for FPM:
--enable-fpm EXPERIMENTAL: Enable building of the fpm SAPI executable
--with-libevent-dir=PATH libevent install prefix, for fpm SAPI. (default: /usr/local)
--with-fpm-user=USER Set the user for php-fpm to run as. (default: nobody)
--with-fpm-group=GRP Set the group for php-fpm to run as. For a system user, this
should usually be set to match the fpm username (default: nobody)



It only seems to affect things when you build in a subdirectory. In this case, I'm adding the FPM stuff into the "build-cgi" phase. Approx line 702 in the spec file above. The configure works fine. It's the linker that actually errors out, w/:

/usr/src/redhat/BUILD/php-5.3.2/build-cgi/libtool: line 1266: sapi/fpm/fpm/fastcgi.loT: No such file or directory
mkdir: cannot create directory `sapi/fpm/fpm/.libs': No such file or directory
make: *** [sapi/fpm/fpm/fastcgi.lo] Error 1
make: *** Waiting for unfinished jobs....
/usr/src/redhat/BUILD/php-5.3.2/build-cgi/libtool: line 1266: sapi/fpm/fpm/fpm.loT: No such file or directory
mkdir: cannot create directory `sapi/fpm/fpm/.libs': No such file or directory



I'd really love to get this fixed, so I can use a nicely packaged version. I have to compile from source already, since we use Oracle here.

Thanks!


Matthew
On 12.05.2010 23:52, Matthew Barr wrote:
> I'd really love to get this fixed, so I can use a nicely packaged version.
> I have to compile from source already, since we use Oracle here.

Please try this patch:
http://dev.daylessday.org/diff/fpm_external_build.diff

--
Wbr,
Antony Dovgal
---
http://pinba.org - realtime statistics for PHP
Re: PHP-FPM & RHEL Specs, or building in subdirectories?
May 12, 2010 04:20PM
Sorry, the hyphen in there is probably a debian/rules thing. It's not a compile option. It's just a workaround to create the missing directory.

At line 538 of that spec file it is making the subdirectories. Should I assume you are adding build-fpm to that list as a subdirectory for building fpm?

At some point in the process the directory build-fpm/sapi/fpm will exist but the directory build-fpm/sapi/fpm/fpm will not. It will try to add files to that missing directory and fail. So as a workaround I added a line to debian/rules to create that missing directory. (For debian that was fpm-build/sapi/fpm/fpm but I see that your rpm calls the subdirectories build-[sapi] instead.)

That spec file you linked doesn't have the fpm parts in it, so I cannot suggest the location, but at some point you add mkdir build-fpm/sapi/fpm/fpm to manually create the missing directory.

Is there an existing bug report for this, btw?
Re: PHP-FPM & RHEL Specs, or building in subdirectories?
May 12, 2010 04:29PM
Antony Dovgal Wrote:
-------------------------------------------------------
> On 12.05.2010 23:52, Matthew Barr wrote:
> > I'd really love to get this fixed, so I can use
> a nicely packaged version.
> > I have to compile from source already, since we
> use Oracle here.
>
> Please try this patch:
> http://dev.daylessday.org/diff/fpm_external_build.
> diff
>
> --
> Wbr,
> Antony Dovgal
> ---
> http://pinba.org - realtime statistics for PHP

Sorry, I fail at mailing lists.

Thanks for the patch, I'll test it on my deb package also.
Re: PHP-FPM & RHEL Specs, or building in subdirectories?
May 12, 2010 05:07PM
Antony Dovgal Wrote:
-------------------------------------------------------
> On 12.05.2010 23:52, Matthew Barr wrote:
> > I'd really love to get this fixed, so I can use
> a nicely packaged version.
> > I have to compile from source already, since we
> use Oracle here.
>
> Please try this patch:
> http://dev.daylessday.org/diff/fpm_external_build.
> diff

The patch solved the issue for me, thanks.
Hmm... Odd. I didn't get about half of the replies, but I got the link to the patch from Brian's last email, and that works.

Reviewing the thread on the forum, I'm actually adding --enable-fpm into the build-cgi build. Not bothering w/ a build-fpm. Then I get to test things, for the first time ;)

It's a pretty complex build, as you'd expect RH's to be, but I'm hopeful.

Had to add a few things to the spec file (for %files section.)

Will have test build done shortly- thanks!

Matthew
On May 12, 2010, at 4:11 PM, Antony Dovgal wrote:

> On 12.05.2010 23:52, Matthew Barr wrote:
>> I'd really love to get this fixed, so I can use a nicely packaged version.
>> I have to compile from source already, since we use Oracle here.
>
> Please try this patch:
> http://dev.daylessday.org/diff/fpm_external_build.diff


Patch worked great. After building it, I've now gone ahead and added in the various FPM files to the spec file %files section.

Only issue is that the build is now loosing the php-cgi binary. No idea where it's going to, which is.. unfortunate. I'd like to end up w/ a clean build, just with added php-fpm support.
--
RPM build errors:
File not found: /var/tmp/php-5.3.2.fpm-1-root-root/usr/bin/php-cgi
---


Here's the patch to the spec file for FPM support, btw:


41,42c41,42
< Version: 5.3.2.fpm
< Release: 2%{?dist}
---
> Version: 5.3.2
> Release: 2%{?dist}
702d706
< --enable-fpm \
1025d1031
< %{_mandir}/man1/php-fpm.1*
1027d1032
< %config %{_sysconfdir}/php-fpm.conf.default
1040d1043
< %{_sbindir}/php-fpm


I'm not firmly attached to any of those files being part of any specfic section, and may move the binaries into the php package vs php-cli. Seems to make more sense to me. Either that, or make a new package: php-fpm, which is fairly easy, and

Now, if we can track down the disappearing binary "php-cgi". Meh. That patch should not have caused it to go away. I suspect it's another part of the fpm Makefile.frag, though.

If we can get this to work nicely, we'll actually have a walk through for building PHP-FPM on a RHEL / CentOS box, while still maintaing the rest of the ecosystem.

Matthew
On May 12, 2010, at 4:11 PM, Antony Dovgal wrote:

> On 12.05.2010 23:52, Matthew Barr wrote:
>> I'd really love to get this fixed, so I can use a nicely packaged version.
>> I have to compile from source already, since we use Oracle here.
>
> Please try this patch:
> http://dev.daylessday.org/diff/fpm_external_build.diff


Patch worked great. After building it, I've now gone ahead and added in the various FPM files to the spec file %files section.

Only issue is that the build is now loosing the php-cgi binary. No idea where it's going to, which is.. unfortunate. I'd like to end up w/ a clean build, just with added php-fpm support.
--
RPM build errors:
File not found: /var/tmp/php-5.3.2.fpm-1-root-root/usr/bin/php-cgi
---


Here's the patch to the spec file for FPM support, btw:


41,42c41,42
< Version: 5.3.2.fpm
< Release: 2%{?dist}
---
> Version: 5.3.2
> Release: 2%{?dist}
702d706
< --enable-fpm \
1025d1031
< %{_mandir}/man1/php-fpm.1*
1027d1032
< %config %{_sysconfdir}/php-fpm.conf.default
1040d1043
< %{_sbindir}/php-fpm


I'm not firmly attached to any of those files being part of any specfic section, and may move the binaries into the php package vs php-cli. Seems to make more sense to me. Either that, or make a new package: php-fpm, which is fairly easy, and

Now, if we can track down the disappearing binary "php-cgi". Meh. That patch should not have caused it to go away. I suspect it's another part of the fpm Makefile.frag, though.

If we can get this to work nicely, we'll actually have a walk through for building PHP-FPM on a RHEL / CentOS box, while still maintaing the rest of the ecosystem.

Matthew
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 246
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready