in Linux, PHP

Compile PHP 5.2.17 using phpfarm

In general phpfarm is working well in case you need multiple php environment in single machine. Special case is for PHP 5.2.17 (latest version of 5.2 generation), I got this error when compile :

opt/phpfarm/src/php-5.2.17/ext/dom/node.c: In function ‘zim_domnode_getNodePath’:
/opt/phpfarm/src/php-5.2.17/ext/dom/node.c:2002:8: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
value = xmlGetNodePath(nodep);
make: *** [ext/dom/node.lo] Error 1
make failed.

Google suggest me for apply patch.

php programmer

$cd php-5.2.17

$sudo curl -o php-5.2.17.patch
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
100  1817  100  1817    0     0    722      0  0:00:02  0:00:02 –:–:–   722

run the patch ::

$sudo patch -p0 -b < php-5.2.17.patch

patching file ext/dom/node.c
Hunk #1 succeeded at 1950 (offset 55 lines).
patching file ext/dom/documenttype.c
Hunk #1 succeeded at 215 (offset 10 lines).
patching file ext/simplexml/simplexml.c
Hunk #1 succeeded at 1343 (offset -74 lines).

$cd ..

$ sudo ./ 5.2.17

and finally get this :

Build complete.
Don’t forget to run ‘make test’.

Installing PHP SAPI module:       cgi
Installing PHP CGI binary: /opt/phpfarm/inst/php-5.2.17/bin/
Installing PHP CLI binary:        /opt/phpfarm/inst/php-5.2.17/bin/
Installing PHP CLI man page:      /opt/phpfarm/inst/php-5.2.17/man/man1/
Installing build environment:     /opt/phpfarm/inst/php-5.2.17/lib/php/build/
Installing header files:          /opt/phpfarm/inst/php-5.2.17/include/php/
Installing helper programs:       /opt/phpfarm/inst/php-5.2.17/bin/
program: phpize
program: php-config
Installing man pages:             /opt/phpfarm/inst/php-5.2.17/man/man1/
page: phpize.1
page: php-config.1
Installing PDO headers:          /opt/phpfarm/inst/php-5.2.17/include/php/ext/pdo/


check version now ::

$ /opt/phpfarm/inst/php-5.2.17/bin/php -v

PHP 5.2.17 (cli) (built: Sep 24 2014 16:53:53) (DEBUG)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies

Archive patch for backup (php5.2.17.patch.txt)