|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-09-19 13:42 UTC] d dot wynne at ljmu dot ac dot uk
Description:
------------
Thsi line causes Segmentation fault:
if (!($ldap = ldap_connect("localhost"))) {
./configure '--prefix=/usr' '--datadir=/usr/share/php' '--mandir=/usr/share/man' '--bindir=/usr/bin' '--includedir=/usr/include' '--sysconfdir=/etc' '--with-config-file-path=/etc' '--with-exec-dir=/usr/lib/php/bin' '--enable-debug' '--enable-inline-optimization' '--enable-memory-limit' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sigchild' '--disable-ctype' '--with-mysql=/usr' '--with-mssql=/usr' '--with-oci8=/net/oracle/10g' '--disable-cgi' '--with-pear=/usr/share/php' '--with-openssl' '--with-ldap' '--with-apxs2=/usr/sbin/apxs2-prefork'
Some libraries come with both 32bit & 64bit versions:
openldap2-client-32bit-2.3.19-18
openldap2-client-2.3.19-18
I manually moved the /usr/lib64 libraries to /usr/lib. No way to use configure to do this. Rebuilt php 4.4.4 ( also tried 4.4.3 earlier ). Same result.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 19:00:01 2025 UTC |
This is my php-4.4.4 --without-mysql variant. The production apache module I normally use obviously has MySQL support Using browser to test MySQL connections PEAR DB Error: extension not found Standard Fatal error: Call to undefined function: mysql_connect() in /home/ftpserver/www/homepage/staff/cmsdwynn/php/mysqlconn.php on line 2 Backtrace: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 47225668576928 (LWP 31755)] 0x00002af39405c481 in ldap_unbind_ext () from /usr/lib64/libldap-2.3.so.0 (gdb)bt #0 0x00002af39405c481 in ldap_unbind_ext () from /usr/lib64/libldap-2.3.so.0 #1 0x00002af396202c9e in _close_ldap_link (rsrc=<value optimized out>) at /home/cmstechs/cmsdwynn/SuSE/php-4.4.4/ext/ldap/ldap.c:175 #2 0x00002af3962c46fe in list_entry_destructor (ptr=<value optimized out>) at /home/cmstechs/cmsdwynn/SuSE/php-4.4.4/Zend/zend_list.c:177 #3 0x00002af3962c403a in zend_hash_del_key_or_index (ht=0x2af396449268, arKey=0x0, nKeyLength=0, h=6, flag=<value optimized out>) at /home/cmstechs/cmsdwynn/SuSE/php-4.4.4/Zend/zend_hash.c:529 #4 0x00002af3962c4907 in _zend_list_delete (id=<value optimized out>) at /home/cmstechs/cmsdwynn/SuSE/php-4.4.4/Zend/zend_list.c:56 #5 0x00002af3962b4a76 in _zval_ptr_dtor (zval_ptr=0x555555931330) at /home/cmstechs/cmsdwynn/SuSE/php-4.4.4/Zend/zend_execute_API.c:289 #6 0x00002af3962c2688 in zend_hash_clean (ht=0x5555559030e8) at /home/cmstechs/cmsdwynn/SuSE/php-4.4.4/Zend/zend_hash.c:584 #7 0x00002af3962d2d69 in execute (op_array=0x555555911b98) at /home/cmstechs/cmsdwynn/SuSE/php-4.4.4/Zend/zend_execute.c:1736 #8 0x00002af3962d0a29 in execute (op_array=0x5555558e3ff8) at /home/cmstechs/cmsdwynn/SuSE/php-4.4.4/Zend/zend_execute.c:1719 #9 0x00002af3962bd2a9 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /home/cmstechs/cmsdwynn/SuSE/php-4.4.4/Zend/zend.c:934 #10 0x00002af39628ee57 in php_execute_script (primary_file=0x7fff16f175d0) at /home/cmstechs/cmsdwynn/SuSE/php-4.4.4/main/main.c:1752 #11 0x00002af3962dafc1 in php_handler (r=0x5555558e81d8) at /home/cmstechs/cmsdwynn/SuSE/php-4.4.4/sapi/apache2handler/sapi_apache2.c:581 #12 0x000055555558c6ba in ap_run_handler () from /usr/sbin/httpd2-prefork #13 0x000055555558faa2 in ap_invoke_handler () from /usr/sbin/httpd2-prefork #14 0x000055555559a1c8 in ap_process_request () from /usr/sbin/httpd2-prefork #15 0x0000555555597409 in ap_register_input_filter () from /usr/sbin/httpd2-prefork #16 0x0000555555593772 in ap_run_process_connection () from /usr/sbin/httpd2-prefork #17 0x000055555559dc09 in ap_graceful_stop_signalled () from /usr/sbin/httpd2-prefork #18 0x000055555559de0e in ap_graceful_stop_signalled () from /usr/sbin/httpd2-prefork #19 0x000055555559e911 in ap_mpm_run () from /usr/sbin/httpd2-prefork #20 0x0000555555579cb8 in main () from /usr/sbin/httpd2-prefork (gdb)Sticking with: openldap2-2.3.19 php 4.4.4 Certainly the introduction of ldap:// in front of the hostname stopped the Segmentatio fault on the ldap_connect. The script still Segmentation faulted later on as there are lots of ldap_* functions. I also was unsure of where to put: -DLDAP_DEPRECATED=1 In php 4.4.4 there is no Makefile in ext/ldap, so in config.m4: CPPFLAGS="$CPPFLAGS -I$LDAP_INCDIR" changed to: CPPFLAGS="$CPPFLAGS -I$LDAP_INCDIR -DLDAP_DEPRECATED=1" Still Segfaults, but looking at the output of make the -DLDAP_DEPRECATED=1 didn't seem to be getting passed. Instead changed the "top-level" Makefile, there are 3 "libtool" lines, and changed -DLDAP_DEPRECATED to -DLDAP_DEPRECATED=1 $(LIBTOOL) --mode=compile $(CC) -D_FORTIFY_SOURCE=2 -DLDAP_DEPRECATED=1 -I/usr/include/apache2-prefork -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -I/usr/include -I/usr/include/apr-1 -Isapi/apache2handler/ -I/home/cmstechs/cmsdwynn/SuSE/php-4.4.4/sapi/apache2handler/ $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) -c /home/cmstechs/cmsdwynn/SuSE/php-4.4.4/sapi/apache2handler/sapi_apache2.c -o sapi/apache2handler/sapi_apache2.lo sapi/apache2handler/apache_config.lo: /home/cmstechs/cmsdwynn/SuSE/php-4.4.4/sapi/apache2handler/apache_config.c $(LIBTOOL) --mode=compile $(CC) -D_FORTIFY_SOURCE=2 -DLDAP_DEPRECATED=1 ..... Again still segfaults.Apply this patch, run make clean && ./buildconf && ./config.nice && make Index: ext/ldap/config.m4 =================================================================== RCS file: /repository/php-src/ext/ldap/config.m4,v retrieving revision 1.26.2.8.2.1 diff -u -p -d -r1.26.2.8.2.1 config.m4 --- ext/ldap/config.m4 3 Nov 2005 20:41:56 -0000 1.26.2.8.2.1 +++ ext/ldap/config.m4 4 Oct 2006 15:12:48 -0000 @@ -23,7 +23,7 @@ PHP_ARG_WITH(ldap,for LDAP support, if test "$PHP_LDAP" != "no"; then - PHP_NEW_EXTENSION(ldap, ldap.c, $ext_shared) + PHP_NEW_EXTENSION(ldap, ldap.c, $ext_shared,,-DLDAP_DEPRECATED=1) if test "$PHP_LDAP" = "yes"; then for i in /usr/local /usr; do