PHP-FPM Patch for 5.2.10 is available

12 views
Skip to first unread message

Michael Shadle

unread,
Jun 19, 2009, 2:40:02 AM6/19/09
to highloa...@googlegroups.com
Note: this has not been really tested, but apparently compiles properly.

Thanks to "thirdwheel" on IRC.

http://php-fpm.org/downloads/php-5.2.10-fpm-0.5.10.diff.gz

I'm working on getting the website going too. Hopefully Andrei can
fill in the missing pieces of it tomorrow for me.

ScriptInstallation.in

unread,
Jun 19, 2009, 2:53:28 AM6/19/09
to highload-php-en
Good work Michael for making php 5.2.10 path available. I was not
using php-fpm as there is no official patch for v 5.2.9, i will try
this.

fei

unread,
Jun 19, 2009, 3:18:23 AM6/19/09
to highloa...@googlegroups.com
Good Work---Thanks a lot!

Posted at Nginx Forum: http://forum.nginx.org/read.php?3,3105,3108#msg-3108

fei

unread,
Jun 19, 2009, 3:34:42 AM6/19/09
to highloa...@googlegroups.com
I haveTried.But Get
/root/php-5.2.10/sapi/cgi/cgi_main.c:1341:30: error: fpm/fpm_autoconf.h: No such file or directory
/root/php-5.2.10/sapi/cgi/cgi_main.c: In function 'zm_info_cgi':
/root/php-5.2.10/sapi/cgi/cgi_main.c:1345: error: 'PHP_FPM_VERSION' undeclared (first use in this function)
/root/php-5.2.10/sapi/cgi/cgi_main.c:1345: error: (Each undeclared identifier is reported only once
/root/php-5.2.10/sapi/cgi/cgi_main.c:1345: error: for each function it appears in.)
make: *** Error 1
OS Gentoo ~X86 And Debian Lenny.

Posted at Nginx Forum: http://forum.nginx.org/read.php?3,3105,3109#msg-3109

fei

unread,
Jun 19, 2009, 3:47:08 AM6/19/09
to highloa...@googlegroups.com
And I configure --help without --enable-fpm.

Posted at Nginx Forum: http://forum.nginx.org/read.php?3,3105,3110#msg-3110

Usu

unread,
Jun 19, 2009, 5:58:02 AM6/19/09
to highload-php-en
I got the same error, debian lenny x64

trying to compile with:

# ./configure --enable-fastcgi --enable-fpm --with-mcrypt --with-zlib
--enable-mbstring --with-openssl --with-mysql --with-mysql-sock --with-
gd --with-jpeg-dir=/usr/lib --enable-gd-native-ttf --without-sqlite --
disable-pdo --disable-reflection --with-curl=/usr/include/curl

# make all install

bizhat

unread,
Jun 19, 2009, 7:50:08 AM6/19/09
to highloa...@googlegroups.com
Make failed with error


/usr/local/src/php-5.2.10/sapi/cgi/cgi_main.c:1341:30: error: fpm/fpm_autoconf.h: No such file or directory
/usr/local/src/php-5.2.10/sapi/cgi/cgi_main.c: In function 'zm_info_cgi':
/usr/local/src/php-5.2.10/sapi/cgi/cgi_main.c:1345: error: 'PHP_FPM_VERSION' undeclared (first use in this function)
/usr/local/src/php-5.2.10/sapi/cgi/cgi_main.c:1345: error: (Each undeclared identifier is reported only once
/usr/local/src/php-5.2.10/sapi/cgi/cgi_main.c:1345: error: for each function it appears in.)
make: *** Error 1


Waiting for fixed patch

Posted at Nginx Forum: http://forum.nginx.org/read.php?3,3105,3120#msg-3120

Liút

unread,
Jun 19, 2009, 7:21:15 AM6/19/09
to highload-php-en
Great! FreeBSD7 amd64 complied OK!

Jim Ohlstein

unread,
Jun 19, 2009, 9:36:26 AM6/19/09
to highloa...@googlegroups.com
Failed to compile on CentOS 5.3 (tried on 32 and 64 bit test servers).

/usr/local/src/php-5.2.10/sapi/cgi/cgi_main.c:1341:30: error: fpm/fpm_autoconf.h: No such file or directory
/usr/local/src/php-5.2.10/sapi/cgi/cgi_main.c: In function 'zm_info_cgi':
/usr/local/src/php-5.2.10/sapi/cgi/cgi_main.c:1345: error: 'PHP_FPM_VERSION' undeclared (first use in this function)
/usr/local/src/php-5.2.10/sapi/cgi/cgi_main.c:1345: error: (Each undeclared identifier is reported only once
/usr/local/src/php-5.2.10/sapi/cgi/cgi_main.c:1345: error: for each function it appears in.)
make: *** Error 1

Also, Mike, you have an error in the version on the download page - should say "php-5.2.10".

Posted at Nginx Forum: http://forum.nginx.org/read.php?3,3105,3134#msg-3134

Edho P Arief

unread,
Jun 19, 2009, 9:54:35 AM6/19/09
to highloa...@googlegroups.com
On Fri, Jun 19, 2009 at 8:36 PM, Jim Ohlstein<nginx...@nginx.us> wrote:
>
> Failed to compile on CentOS 5.3 (tried on 32 and 64 bit test servers).
>
> /usr/local/src/php-5.2.10/sapi/cgi/cgi_main.c:1341:30: error: fpm/fpm_autoconf.h: No such file or directory
> /usr/local/src/php-5.2.10/sapi/cgi/cgi_main.c: In function 'zm_info_cgi':
> /usr/local/src/php-5.2.10/sapi/cgi/cgi_main.c:1345: error: 'PHP_FPM_VERSION' undeclared (first use in this function)
> /usr/local/src/php-5.2.10/sapi/cgi/cgi_main.c:1345: error: (Each undeclared identifier is reported only once
> /usr/local/src/php-5.2.10/sapi/cgi/cgi_main.c:1345: error: for each function it appears in.)
> make: ***  Error 1
>

same error on opensolaris (using gnu tools)


--
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

Yorgo Sun

unread,
Jun 19, 2009, 10:33:14 AM6/19/09
to highloa...@googlegroups.com
I've patched php-5.2.10 using php-5.2.8-fpm-0.5.10.diff. It only have two point of confusions.
One is php-5.2.10/configure.rej another is php-5.2.10/sapi/cgi/fastcgi.c.rej. just move that diff codes into really code files. than you can pass the compile.

2009/6/19 Edho P Arief <edho...@gmail.com>



--
孙绍轩 Yorgo Sun

Michael Shadle

unread,
Jun 19, 2009, 11:02:06 AM6/19/09
to highloa...@googlegroups.com
Sorry all -

I'll have to bug who did it on IRC, it compiled for him and I thought
one other person reported success. Welcome to a fresh start :)

I will personally validate it myself next time too, I did not have
time this time to try.

So for the moment I will comment the link out (thanks Jim) and say
"proper 5.2.10 patch coming"

Yorgo: there's two things

a) if it can compile
b) if it's really actually working properly / not a totally messed up hack

I want to make sure that it's functional, not just passing the "can it
compile" test :)

Yorgo Sun

unread,
Jun 19, 2009, 10:02:22 PM6/19/09
to highloa...@googlegroups.com
I've compiled one and testing. everything are fine currently.

I just tell all of you what I did. and we can test it together.

It's only two file can't patch 5.2.8's patch correct: ./configure and ./sapi/cgi/fastcgi.c
for the configure file, it can't patched correct because two of lines are different with 5.2.8 and 5.2.10 original source code. these lines just want to output some message, so it's safe to modify that code.

the patch file want to delete some code in fastcgi.c, but that code changed, so patch can't work.
You can checkout ./sapi/cgi/fastcgi.c and find some code like these:

        if (!tcp) {
                chmod(path, 0777);
-       } else {
-           char *ip = getenv("FCGI_WEB_SERVER_ADDRS");
-           char *cur, *end;
-           int n;
-
-           if (ip) {
-               ip = strdup(ip);
-               cur = ip;
-               n = 0;
-               while (*cur) {
-                       if (*cur == ',') n++;
-                       cur++;
-               }
-               allowed_clients = malloc(sizeof(in_addr_t) * (n+2));
-               n = 0;
-               cur = ip;
-               while (cur) {
-                       end = strchr(cur, ',');
-                       if (end) {
-                               *end = 0;
-                               end++;
-                       }
-                       allowed_clients[n] = inet_addr(cur);
-                       if (allowed_clients[n] == INADDR_NONE) {
-                                       fprintf(stderr, "Wrong IP address '%s' in FCGI_WEB_SERVER_ADDRS\n", cur);
-                       }
-                       n++;
-                       cur = end;
-               }
-               allowed_clients[n] = INADDR_NONE;
-                       free(ip);
-               }
        }

Delete all the else segment's code.

That's all. you can try to compile it now.

the attachment is the patch I made. you can try it directly. every problems can post on this mail and I'll try to check.

2009/6/19 Michael Shadle <mik...@gmail.com>



--
孙绍轩 Yorgo Sun

php-5.2.10-fpm-0.5.10.diff.gz

Yorgo Sun

unread,
Jun 20, 2009, 1:45:23 AM6/20/09
to highloa...@googlegroups.com
my php-fpm's test result

=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :   52
Exts tested     :   27
---------------------------------------------------------------------

Number of tests : 8282              6309
Tests skipped   : 1973 ( 23.8%) --------
Tests warned    :    3 (  0.0%) (  0.0%)
Tests failed    :   14 (  0.2%) (  0.2%)
Expected fail   :    3 (  0.0%) (  0.0%)
Tests passed    : 6289 ( 75.9%) ( 99.7%)
---------------------------------------------------------------------
Time taken      :  278 seconds
=====================================================================

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Bug #22592 (cascading assignments to strings with curly braces broken) [tests/lang/bug22592.phpt]
Bug #48058 (Year formatter goes wrong with out-of-int range) [ext/date/tests/bug48058.phpt]
date_create() with large relative offsets [ext/date/tests/date_create-relative.phpt]
Bug #16069 (ICONV transliteration failure) [ext/iconv/tests/bug16069.phpt]
iconv stream filter [ext/iconv/tests/iconv_stream_filter_delimiter.phpt]
Bug #41125 (PDO mysql + quote() + prepare() can result in seg fault) [ext/pdo_mysql/tests/bug41125.phpt]
Bug #44327 (PDORow::queryString property & numeric offsets / Crash) [ext/pdo_mysql/tests/bug44327.phpt]
posix_initgroups(): Basic tests [ext/posix/tests/posix_initgroups.phpt]
posix_initgroups(): Basic tests [ext/posix/tests/posix_initgroups_basic.phpt]
Test natcasesort() function : usage variations - different numeric types [ext/standard/tests/array/natcasesort_variation3.phpt]
Test gethostbynamel() function : error conditions [ext/standard/tests/network/gethostbynamel_error.phpt]
Bug #38770 (unpack() broken with longs on 64 bit machines) [ext/standard/tests/strings/bug38770.phpt]
htmlentities() test 2 (setlocale / fr_FR.ISO-8859-15) [ext/standard/tests/strings/htmlentities02.phpt] (warn: possibly braindead libc)
htmlentities() test 4 (setlocale / ja_JP.EUC-JP) [ext/standard/tests/strings/htmlentities04.phpt] (warn: possibly braindead libc)
htmlentities() test 15 (setlocale / KOI8-R) [ext/standard/tests/strings/htmlentities15.phpt] (warn: possibly braindead libc)
xmlwriter_open_uri with PHP_MAXPATHLEN + 1 [ext/xmlwriter/tests/bug48204.phpt]
xmlwriter_write_attribute_ns with missing param [ext/xmlwriter/tests/xmlwriter_write_attribute_ns_error_001.phpt]
=====================================================================

=====================================================================
EXPECTED FAILED TEST SUMMARY
---------------------------------------------------------------------
ob_start(): Ensure unerasable buffer cannot be flushed by ob_flush(). [tests/output/ob_start_basic_unerasable_005.phpt]
Bug #42718 (unsafe_raw filter not applied when configured as default filter) [ext/filter/tests/bug42718.phpt]
SPL: ArrayObject::exchangeArray() basic usage with object as underlying data store. [ext/spl/tests/arrayObject_exchangeArray_basic3.phpt]
=====================================================================

=====================================================================
WARNED TEST SUMMARY
---------------------------------------------------------------------
htmlentities() test 2 (setlocale / fr_FR.ISO-8859-15) [ext/standard/tests/strings/htmlentities02.phpt] (warn: possibly braindead libc)
htmlentities() test 4 (setlocale / ja_JP.EUC-JP) [ext/standard/tests/strings/htmlentities04.phpt] (warn: possibly braindead libc)
htmlentities() test 15 (setlocale / KOI8-R) [ext/standard/tests/strings/htmlentities15.phpt] (warn: possibly braindead libc)
=====================================================================


2009/6/20 Yorgo Sun <yorg...@gmail.com>



--
孙绍轩 Yorgo Sun

Momchil Ivanov

unread,
Jun 20, 2009, 8:56:09 AM6/20/09
to highloa...@googlegroups.com
На Saturday 20 June 2009 04:02:22 Yorgo Sun написа:
> I've compiled one and testing. everything are fine currently.
> I just tell all of you what I did. and we can test it together.
>
> It's only two file can't patch 5.2.8's patch correct: ./configure and
> ./sapi/cgi/fastcgi.c
> for the configure file, it can't patched correct because two of lines are
> different with 5.2.8 and 5.2.10 original source code. these lines just want
> to output some message, so it's safe to modify that code.

You can ignore patching configure completely as long as you do the following
after patching all the other files:

# rm configure
# ./buildconf --force

Momchil

--
PGP KeyID: 0x3118168B
Keyserver: pgp.mit.edu
Key fingerprint BB50 2983 0714 36DC D02E  158A E03D 56DA 3118 168B

signature.asc

Jim Ohlstein

unread,
Jun 20, 2009, 12:35:28 PM6/20/09
to highloa...@googlegroups.com
I had a bit more time to test this out today. Using the original patch for php-5.2.8 (php-5.2.8-fpm-0.5.10.diff) and manually editing php-5.2.10/sapi/cgi/fastcgi.c based on php-5.2.10/sapi/cgi/fastcgi.c.rej, and then rebuilding configure I got it to compile on CentOS 5.3 (both 32 and 64 bit versions) and it appears to be working. I've put it in production here at the nginx forum for now.

Posted at Nginx Forum: http://forum.nginx.org/read.php?3,3105,3188#msg-3188

Michael Shadle

unread,
Jun 20, 2009, 2:40:13 PM6/20/09
to highloa...@googlegroups.com
Oddly enough when trying this I keep getting a missing config.sub file.

Total failure when trying to buildconf --force because of it. Hrm.

Michael Shadle

unread,
Jun 20, 2009, 4:08:07 PM6/20/09
to highloa...@googlegroups.com
Disregard this. For some reason it was missing when I tried a vanilla build too.
I think it was due to some extra spacing in my shell script, of all reasons.
Reply all
Reply to author
Forward
0 new messages