pcre error - undefined reference to pcre_info

mariosneto

Registered
Jul 24, 2014
1
0
1
cPanel Access Level
Root Administrator
I need to install PHP 5.2.17 (Custom Modules) but easyapache stops with the following error:

/home/cpeasyapache/src/php-5.2.17/ext/pcre/php_pcre.c: 259: undefined reference to `pcre_info '
collect2: ld returned 1 exit status

I can install a compatible version of pcre (8.20), but the easy apache update to the latest version of pcre again (8.35) and build failed:

"!! Installing or updating 'pcre', this will take a while and shouldn't have to be done again until a new version is released by the vendor. !!"

Can anyone help me?

Regards
 

ScottTh

Well-Known Member
Jan 28, 2013
157
2
18
Houston, TX
cPanel Access Level
Root Administrator
I need to install PHP 5.2.17 (Custom Modules) but easyapache stops with the following error:

/home/cpeasyapache/src/php-5.2.17/ext/pcre/php_pcre.c: 259: undefined reference to `pcre_info '
collect2: ld returned 1 exit status

I can install a compatible version of pcre (8.20), but the easy apache update to the latest version of pcre again (8.35) and build failed:

"!! Installing or updating 'pcre', this will take a while and shouldn't have to be done again until a new version is released by the vendor. !!"

Can anyone help me?

Regards
Hello mariosneto,

Custom opt mods are not maintained to work with all contemporary and up to date components of EasyApache. We provide them with the understanding that the implementer may need to perform additional work to achieve their desired environment.

At this point it you'll need to manually include PCRE 8.20 with the PHP 5.2 opt mod.

Thank you for the question.
 

Viperboy

Registered
Dec 23, 2009
3
0
51
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...
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,216
463
Hello :)

Information on Raw Opts is documented here:

Raw Opts

Thank you.
 

siriusb

Member
Mar 10, 2009
22
2
53
Argentina
cPanel Access Level
Root Administrator
Hello Michael.
Thank you for reply.

I follow the guide, but I still getting an error:

I follow the guide, (here, Argentina, are 5 am) and I still get errors.

Code:
[email protected]:[~]: cat /var/cpanel/easy/apache/rawopts/all_php4
--with-pcre-dir=/usr/src/pcre-8.20
--with-pcre-regex=/usr/src/pcre-8.20

[email protected]:[~]: file /usr/src/pcre-8.20
/usr/src/pcre-8.20: directory

This is an extract of last lines:

----
Code:
/bin/sh /home/cpeasyapache/src/php-4.4.9/libtool --silent --preserve-dup-deps --mode=link gcc -export-dynamic --param ggc-min-expand=1 --param ggc-min-heapsize=4096 -L/opt/pcre/lib -L/opt/curlssl/lib -L/opt/curlssl//lib -L/opt/php_with_imap_client//lib -L/opt/libmcrypt//lib -L/opt/mhash//lib -L/usr/lib -lstdc++ -R /opt/pcre/lib -R /opt/curlssl/lib -R /opt/curlssl//lib -R /opt/php_with_imap_client//lib -R /opt/libmcrypt//lib -R /opt/mhash//lib -R /usr/lib ext/openssl/openssl.lo ext/pcre/php_pcre.lo ext/zlib/zlib.lo ext/zlib/zlib_fopen_wrapper.lo ext/bcmath/bcmath.lo ext/bcmath/libbcmath/src/add.lo ext/bcmath/libbcmath/src/div.lo ext/bcmath/libbcmath/src/init.lo ext/bcmath/libbcmath/src/neg.lo ext/bcmath/libbcmath/src/outofmem.lo ext/bcmath/libbcmath/src/raisemod.lo ext/bcmath/libbcmath/src/rt.lo ext/bcmath/libbcmath/src/sub.lo ext/bcmath/libbcmath/src/compare.lo ext/bcmath/libbcmath/src/divmod.lo ext/bcmath/libbcmath/src/int2num.lo ext/bcmath/libbcmath/src/num2long.lo ext/bcmath/libbcmath/src/output.lo ext/bcmath/libbcmath/src/recmul.lo ext/bcmath/libbcmath/src/sqrt.lo ext/bcmath/libbcmath/src/zero.lo ext/bcmath/libbcmath/src/debug.lo ext/bcmath/libbcmath/src/doaddsub.lo ext/bcmath/libbcmath/src/nearzero.lo ext/bcmath/libbcmath/src/num2str.lo ext/bcmath/libbcmath/src/raise.lo ext/bcmath/libbcmath/src/rmzero.lo ext/bcmath/libbcmath/src/str2num.lo ext/calendar/calendar.lo ext/calendar/dow.lo ext/calendar/french.lo ext/calendar/gregor.lo ext/calendar/jewish.lo ext/calendar/julian.lo ext/calendar/easter.lo ext/calendar/cal_unix.lo ext/ctype/ctype.lo ext/curl/curl.lo ext/curl/curlstreams.lo ext/ftp/php_ftp.lo ext/ftp/ftp.lo ext/gd/gd.lo ext/gd/gdttf.lo ext/gd/libgd/gd.lo ext/gd/libgd/gd_gd.lo ext/gd/libgd/gd_gd2.lo ext/gd/libgd/gd_io.lo ext/gd/libgd/gd_io_dp.lo ext/gd/libgd/gd_io_file.lo ext/gd/libgd/gd_ss.lo ext/gd/libgd/gd_io_ss.lo ext/gd/libgd/gd_png.lo ext/gd/libgd/gd_jpeg.lo ext/gd/libgd/gdxpm.lo ext/gd/libgd/gdfontt.lo ext/gd/libgd/gdfonts.lo ext/gd/libgd/gdfontmb.lo ext/gd/libgd/gdfontl.lo ext/gd/libgd/gdfontg.lo ext/gd/libgd/gdtables.lo ext/gd/libgd/gdft.lo ext/gd/libgd/gdcache.lo ext/gd/libgd/gdkanji.lo ext/gd/libgd/wbmp.lo ext/gd/libgd/gd_wbmp.lo ext/gd/libgd/gdhelpers.lo ext/gd/libgd/gd_topal.lo ext/gd/libgd/gd_gif_in.lo ext/gd/libgd/xbm.lo ext/gd/libgd/gd_gif_out.lo ext/gd/libgd/gd_security.lo ext/imap/php_imap.lo ext/mcrypt/mcrypt.lo ext/mhash/mhash.lo ext/mysql/php_mysql.lo ext/overload/overload.lo ext/posix/posix.lo ext/session/session.lo ext/session/mod_files.lo ext/session/mod_mm.lo ext/session/mod_user.lo ext/sockets/sockets.lo regex/regcomp.lo regex/regexec.lo regex/regerror.lo regex/regfree.lo ext/standard/array.lo ext/standard/base64.lo ext/standard/basic_functions.lo ext/standard/browscap.lo ext/standard/crc32.lo ext/standard/crypt.lo ext/standard/cyr_convert.lo ext/standard/datetime.lo ext/standard/dir.lo ext/standard/dl.lo ext/standard/dns.lo ext/standard/exec.lo ext/standard/file.lo ext/standard/filestat.lo ext/standard/flock_compat.lo ext/standard/formatted_print.lo ext/standard/fsock.lo ext/standard/head.lo ext/standard/html.lo ext/standard/image.lo ext/standard/info.lo ext/standard/iptc.lo ext/standard/lcg.lo ext/standard/link.lo ext/standard/mail.lo ext/standard/math.lo ext/standard/md5.lo ext/standard/metaphone.lo ext/standard/microtime.lo ext/standard/pack.lo ext/standard/pageinfo.lo ext/standard/parsedate.lo ext/standard/quot_print.lo ext/standard/rand.lo ext/standard/reg.lo ext/standard/soundex.lo ext/standard/string.lo ext/standard/scanf.lo ext/standard/syslog.lo ext/standard/type.lo ext/standard/uniqid.lo ext/standard/url.lo ext/standard/url_scanner.lo ext/standard/var.lo ext/standard/versioning.lo ext/standard/assert.lo ext/standard/strnatcmp.lo ext/standard/levenshtein.lo ext/standard/incomplete_class.lo ext/standard/url_scanner_ex.lo ext/standard/ftp_fopen_wrapper.lo ext/standard/http_fopen_wrapper.lo ext/standard/php_fopen_wrapper.lo ext/standard/credits.lo ext/standard/css.lo ext/standard/var_unserializer.lo ext/standard/ftok.lo ext/standard/aggregation.lo ext/standard/sha1.lo ext/tokenizer/tokenizer.lo ext/xml/xml.lo ext/xml/expat/xmlparse.lo ext/xml/expat/xmlrole.lo ext/xml/expat/xmltok.lo TSRM/TSRM.lo TSRM/tsrm_strtok_r.lo TSRM/tsrm_virtual_cwd.lo main/main.lo main/snprintf.lo main/spprintf.lo main/php_sprintf.lo main/safe_mode.lo main/fopen_wrappers.lo main/alloca.lo main/php_scandir.lo main/php_ini.lo main/SAPI.lo main/rfc1867.lo main/php_content_types.lo main/strlcpy.lo main/strlcat.lo main/mergesort.lo main/reentrancy.lo main/php_variables.lo main/php_ticks.lo main/streams.lo main/network.lo main/php_open_temporary_file.lo main/php_logos.lo main/output.lo main/memory_streams.lo main/user_streams.lo Zend/zend_language_parser.lo Zend/zend_language_scanner.lo Zend/zend_ini_parser.lo Zend/zend_ini_scanner.lo Zend/zend_alloc.lo Zend/zend_compile.lo Zend/zend_constants.lo Zend/zend_dynamic_array.lo Zend/zend_execute_API.lo Zend/zend_highlight.lo Zend/zend_llist.lo Zend/zend_opcode.lo Zend/zend_operators.lo Zend/zend_ptr_stack.lo Zend/zend_stack.lo Zend/zend_variables.lo Zend/zend.lo Zend/zend_API.lo Zend/zend_extensions.lo Zend/zend_hash.lo Zend/zend_list.lo Zend/zend_indent.lo Zend/zend_builtin_functions.lo Zend/zend_sprintf.lo Zend/zend_ini.lo Zend/zend_qsort.lo Zend/zend_multibyte.lo Zend/zend_strtod.lo Zend/zend_execute.lo sapi/cli/php_cli.lo sapi/cli/getopt.lo main/internal_functions_cli.lo -lcrypt -lc-client -lcrypt -lmysqlclient -lmhash -lmcrypt -lltdl -lssl -lcrypto -lcrypt -lpam -lfreetype -lX11 -lXpm -lpng -lz -ljpeg -lcurl -lz -lpcre -lssl -lcrypto -lresolv -lm -ldl -lnsl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lcurl -lidn -lssl -lcrypto -lssl -lcrypto -lldap -lz -lrt -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lcrypt -lcrypt -o sapi/cli/php
/opt/php_with_imap_client//lib/libc-client.a(osdep.o): In function `ssl_onceonlyinit':
/home/cpeasyapache/src/imap-2007f/c-client/osdep.c:302: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
ext/pcre/php_pcre.o: In function `pcre_get_compiled_regex':
php_pcre.c:(.text+0x431): undefined reference to `pcre_info'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
!! Step 6: make php for apache and cli !!
!! 'make' failed with exit code '512' !!
!! Restoring original working apache !!
!! Executing '/usr/local/cpanel/scripts/initsslhttpd' !!
!! Restarting 'httpd' ... !!
!! 'httpd' restart complete. !!
Building global cache for cpanel...Done
!! Executing '/usr/local/cpanel/scripts/initfpsuexec' !!
!! Executing '/usr/local/cpanel/scripts/initsslhttpd' !!
!! Executing '/usr/local/cpanel/scripts/fixmailman' !!
!! Executing '/usr/local/cpanel/scripts/update_apachectl' !!
!! Executing '/usr/local/cpanel/scripts/enablefileprotect' !!
Compiling report...
Sending report. As some of the attached files may be quite large, this could take a few minutes. Thanks for your patience.
!! If you want to create a support ticket with cPanel regarding this please reference 'BuildAP Report Id': '14978661' !!
Report processed.
!! Feel free to submit a support ticket at [url]https://tickets.cpanel.net/submit/index.cgi?reqtype=tickets[/url] !!
!! Verbose logfile is at '/usr/local/cpanel/logs/easy/apache/build.1415346040' !!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,216
463
The use of PHP 4 as a custom opt module is not supported and we no longer offer it on our custom opt modules page:

Custom Modules

I highly suggest upgrading the scripts that require it to a supported version of PHP.

Thank you.
 

techdruid

Member
Jan 16, 2012
9
0
51
cPanel Access Level
Root Administrator
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.