[Solved]Compiling a second version of PHP (5.2) on Centos 7

General support questions
Post Reply
jrivasg
Posts: 3
Joined: 2015/06/19 18:24:03

[Solved]Compiling a second version of PHP (5.2) on Centos 7

Post by jrivasg » 2015/06/19 18:59:22

Hello, I am trying to install on Centos 7, an older version of PHP (5.2, for a APP Legacy), but when running the build (make) I find the following errors:
/usr/local/php52/ext/dom/node.c: In function 'dom_canonicalization':
/usr/local/php52/ext/dom/node.c:1953:21: error: dereferencing pointer to incomplete type
ret = buf-> Buffer-> use;
^
In file included from /usr/local/php52/main/php.h:38:0,
from /usr/local/php52/ext/dom/node.c:26:
/usr/local/php52/ext/dom/node.c:1955:40: error: dereferencing pointer to incomplete type
RETVAL_STRINGL ((char *) buf-> Buffer-> content, ret, 1);
^
/usr/local/php52/Zend/zend_API.h:472:14: note: in macro definition of 'ZVAL_STRINGL'
char * __ s = (s); int __l = l; \
^
/usr/local/php52/ext/dom/node.c:1955:5: note: in expansion of macro 'RETVAL_STRINGL'
RETVAL_STRINGL ((char *) buf-> Buffer-> content, ret, 1);
^
make: *** [ext / dom / node.lo] Error 1

Anyone have any idea?
Last edited by jrivasg on 2015/06/22 13:52:19, edited 1 time in total.

User avatar
TrevorH
Forum Moderator
Posts: 26942
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Compiling a second version of PHP (5.2) on Centos 7

Post by TrevorH » 2015/06/19 19:02:34

Please please please don't deploy php 5.2 anywhere! It's been unsupported for about 4 years and has numerous unfixed security vuilnerabilities. It is not safe.
CentOS 5 died in March 2017 - migrate NOW!
CentOS 6 goes EOL sooner rather than later, get upgrading!
Full time Geek, part time moderator. Use the FAQ Luke

jrivasg
Posts: 3
Joined: 2015/06/19 18:24:03

Re: Compiling a second version of PHP (5.2) on Centos 7

Post by jrivasg » 2015/06/19 19:05:21

I completely agree TrevorH, but unfortunately still can not migrate the APP.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Compiling a second version of PHP (5.2) on Centos 7

Post by gerald_clark » 2015/06/19 19:40:04

Then fix the app or replace it with something more current.

User avatar
remirepo
Posts: 342
Joined: 2014/09/21 09:07:12
Location: France
Contact:

Re: Compiling a second version of PHP (5.2) on Centos 7

Post by remirepo » 2015/06/20 05:54:03

Use CentOS 6 which provides php 5.3 or CentOS 5 which provides php 5.1

Else you have a real issue.
Nobody serious maintains php 5.2 package which is EOL, and don't even build (as you noticed) because of changes in system libraries.
Remi's Repository - Forum - Blog

jrivasg
Posts: 3
Joined: 2015/06/19 18:24:03

[Solved] Re: Compiling a second version of PHP (5.2) on Cent

Post by jrivasg » 2015/06/22 13:47:33

Finally, I managed to compile the 5.2.17 version by adding the following patch, if you have someone else serves.

$ Php-curl-or 5.2.17.patch https://mail.gnome.org/archives/xml/201 ... XAvz4N.txt

$ Cd php-5.2.17
-p0 $ Patch -b <../ php-5.2.17.patch
patching file ext / dom / node.c
patching file ext / dom / documenttype.c
patching file ext / simplexml / simplexml.c
and recompile again.

Thanks.-

dirtbag
Posts: 8
Joined: 2007/02/06 21:48:03
Contact:

Re: [Solved]Compiling a second version of PHP (5.2) on Centos 7

Post by dirtbag » 2016/08/17 02:33:33

Im not sure about that funky patch command you posted, but here is what I got to work.
after downloading the patch of course..
[root@server php-5.2.17]# patch -p0 < ../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).
[root@server php-5.2.17]#
-db

User avatar
TrevorH
Forum Moderator
Posts: 26942
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: [Solved]Compiling a second version of PHP (5.2) on Centos 7

Post by TrevorH » 2016/08/17 08:25:16

As said multiple times above: php 5.2 is not safe and should not be used.
CentOS 5 died in March 2017 - migrate NOW!
CentOS 6 goes EOL sooner rather than later, get upgrading!
Full time Geek, part time moderator. Use the FAQ Luke

dewolfe001
Posts: 1
Joined: 2016/12/10 00:01:27

Re: [Solved] Re: Compiling a second version of PHP (5.2) on Cent

Post by dewolfe001 » 2016/12/10 00:03:59

Thanks for posting this. It was a big help in getting an install of 5.2 to work.
jrivasg wrote:Finally, I managed to compile the 5.2.17 version by adding the following patch, if you have someone else serves.

$ Php-curl-or 5.2.17.patch https://mail.gnome.org/archives/xml/201 ... XAvz4N.txt

$ Cd php-5.2.17
-p0 $ Patch -b <../ php-5.2.17.patch
patching file ext / dom / node.c
patching file ext / dom / documenttype.c
patching file ext / simplexml / simplexml.c
and recompile again.

Thanks.-

User avatar
TrevorH
Forum Moderator
Posts: 26942
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: [Solved]Compiling a second version of PHP (5.2) on Centos 7

Post by TrevorH » 2016/12/10 00:42:04

Who needs security anyway?
CentOS 5 died in March 2017 - migrate NOW!
CentOS 6 goes EOL sooner rather than later, get upgrading!
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply

Return to “CentOS 7 - General Support”