In a nutshell:
- download pcre 8.20 from
http://downloads.sourceforge.net/project/pcre/pcre/8.20/pcre-8.20.tar.gz to e.g.: /usr/src/
- unzip it, than './configure' and 'make'
- when completed, modify the rawopts for PHP5.2 and add:
Code:
--with-pcre-dir=/usr/src/pcre-8.20
--with-pcre-regex=/usr/src/pcre-8.20
Afterwards the PHP 5.2 can be build successfully.
However I had to do it too, but I agree with the others that PHP5.2 should be upgraded with all the sites using it...
Some additional notes on what I had to do to make this work.
I had to modify the Makefile using vi, and do a replace on the following "/opt" references to it referenced the proper opt files.
Code:
:%s/\/opt\/pcre\/lib/\/usr\/src\/pcre-8\.20\/.libs/g
:%s/\/opt\/pcre\/include/\/usr\/src\/pcre-8\.20/g
Additionally, there were the following error messages when running "# make install"
Code:
/usr/local/apache/build/libtool --mode=install cp libphp5.la /usr/local/apache/modules/
libtool: install: error: cannot install `libphp5.la' to a directory not ending in /usr/local/src/php-5.2.14/libs
So, to correct this problem, I *TEMPORARILY* modified the libtool file referenced at "/usr/local/apache/build/libtool" and commented out the "EXIT" command mentioned below with the pound sign.
Code:
if test "$inst_prefix_dir" = "$destdir"; then
$echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
# exit $EXIT_FAILURE
fi
Be SURE to uncomment the line above once you've compiled everything.
Important. Note that the install will overwrite /usr/local/apache/modules/libphp5.so. So what I did, was made a copy, just in case this new module caused problems and I could rewrite the old one back.
Code:
# cp /usr/local/apache/modules/libphp5.so /usr/local/apache/modules/save.libphp5.so
I'm not sure what consequences there will be knowing that the same version of libphp5.so seems to be used by both php 5.2.14 that I've installed, as well as version 5.3.29 that is installed. So I'm a little worried about that. But for now, I'm going to try and test a 5.2.14 running site to see if things work. At least some of 5.3.29 sites appear to be running with this new/old library.