ID: 50947 User updated by: dax at enst dot fr Reported By: dax at enst dot fr -Status: Feedback +Status: Open Bug Type: Apache2 related Operating System: Solaris10 PHP Version: 5.2.12 New Comment:
Yes, the both was compiled at same time using: ./configure --options_stuff... make make install ls -l /usr/local/apache22/bin/php /usr/local/apache22/modules//libphp5.so -rwxr-xr-x 1 root root 21154620 Feb 7 22:24 /usr/local/apache22/bin/php* -rwxr-xr-x 1 root other 21697020 Feb 7 22:24 /usr/local/apache22/modules//libphp5.so* Only one unique php.ini 2 scripts : 1- cryptok.php: <?php $foo = crypt("bar", "12"); echo "$foo"; ?> 2- cryptbad.php: <?php $foo = crypt("bar"); echo "$foo"; ?> With CLI: both scripts pass 1- scriptok works in module apache mode 2- scriptbad crashes in module apache mode (segmentation fault) Results seem differents about crypt algorithm: 1- scriptok gives: 12.rYi7YWzJVI 2- scriptbad gives: $1$F4XSe/ks$7fQgb9k8xu.gzJOK0QHzO/ Previous Comments: ------------------------------------------------------------------------ [2010-02-07 22:58:02] j...@php.net Did you compile both the same time, ie. using same configure options? And it's CLI that has the libs and does not crash? Are different php.ini files used for both? Does both load same extensions? Are any shared extensions loaded? ------------------------------------------------------------------------ [2010-02-07 21:57:27] dax at enst dot fr Sorry to re-open, I know I have not do all things you have suggested. An answer to the comparaison of dependencies between php command and libphp.so is interesting : diff ldd-cmdphp ldd-libphp 21d20 < libgcrypt.so.11 => /usr/lib/libgcrypt.so.11 25d23 < libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 No static libraries involved ldd libphp5.so libz.so => /usr/lib/libz.so libexslt.so.0 => /usr/lib/libexslt.so.0 libexpat.so.1 => /usr/local/lib/libexpat.so.1 librt.so.1 => /usr/lib/librt.so.1 libmysqlclient.so.16 => /infres/mysql/5.1.30/lib/mysql/libmysqlclient.so.16 libmcrypt.so.4 => /usr/local/lib/libmcrypt.so.4 libltdl.so.7 => /usr/local/lib/libltdl.so.7 libldap-2.4.so.2 => /usr/local/lib/libldap-2.4.so.2 liblber-2.4.so.2 => /usr/local/lib/liblber-2.4.so.2 libintl.so.8 => /usr/local/lib/libintl.so.8 libgd.so.2 => /usr/local/lib/libgd.so.2 libt1.so.5 => /usr/local/lib/libt1.so.5 libfreetype.so.6 => /usr/local/lib/libfreetype.so.6 libX11.so.6.2 => /usr/local/X11R6/lib/libX11.so.6.2 libXpm.so.4.11 => /usr/lib/libXpm.so.4.11 libpng12.so.0 => /usr/lib/libpng12.so.0 libdb-4.5.so => /usr/local/lib/libdb-4.5.so libgdbm.so.3 => /usr/local/lib/libgdbm.so.3 libbz2.so.1.0 => /usr/local/lib/libbz2.so.1.0 libresolv.so.2 => /usr/lib/libresolv.so.2 libm.so.2 => /usr/lib/libm.so.2 libnsl.so.1 => /usr/lib/libnsl.so.1 libsocket.so.1 => /usr/lib/libsocket.so.1 libcurl.so.3 => /usr/local/lib/libcurl.so.3 libssl.so.0.9.8 => /usr/local/lib/libssl.so.0.9.8 libcrypto.so.0.9.8 => /usr/local/ssl/lib/libcrypto.so.0.9.8 libdl.so.1 => /usr/lib/libdl.so.1 libxslt.so.1 => /usr/lib/libxslt.so.1 libxml2.so.2 => /usr/lib/libxml2.so.2 libiconv.so.2 => /usr/local/lib/libiconv.so.2 libc.so.1 => /usr/lib/libc.so.1 libgcc_s.so.1 => /usr/local/gcc3/lib/libgcc_s.so.1 libpthread.so.1 => /usr/lib/libpthread.so.1 libaio.so.1 => /usr/lib/libaio.so.1 libmd.so.1 => /usr/lib/libmd.so.1 libgen.so.1 => /usr/lib/libgen.so.1 libm.so.1 => /usr/lib/libm.so.1 libX11.so.4 => /usr/lib/libX11.so.4 libjpeg.so.62 => /usr/lib/libjpeg.so.62 libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 libXext.so.0 => /usr/lib/libXext.so.0 libmp.so.2 => /usr/lib/libmp.so.2 libscf.so.1 => /usr/lib/libscf.so.1 libexpat.so.0 => (file not found) libdoor.so.1 => /usr/lib/libdoor.so.1 libuutil.so.1 => /usr/lib/libuutil.so.1 /platform/SUNW,T5140/lib/libc_psr.so.1 /platform/SUNW,T5140/lib/libmd_psr.so.1 Apache compilation options : ./configure --prefix=/usr/local/apache22 --enable-so --enable-cgi --enable-cgid --enable-rewrite --enable-speling --enable-info --enable-deflate --enable-headers --enable-vhost-alias --enable-dav --enable-dav-fs --enable-ssl --with-ssl=/usr/local/ssl --enable-proxy --enable-proxy-connect --enable-proxy-ftp --enable-proxy-http --enable-ldap --with-ldap --enable-authnz-ldap --enable-expires Apache runtime : LD_LIBRARY_PATH=/usr/local/apache22/lib:/usr/local/apache22/modules:/usr/local/apr/lib:/usr/local/ssl/lib:/usr/local/gcc3/lib:/usr/local/lib:$LD_LIBRARY_PATH ------------------------------------------------------------------------ [2010-02-07 17:35:48] j...@php.net Try compare what the cli binary is linked with and what the apache module is linked with. And also, depending if there are static libraries involved, the order of libs matters as well. And you should try compiling the apache module again, this time with minimum configure options. And if crypt() works then, try adding the remaining options one by one to see which causes the problem. It's possible this is only a problem with your system involved.. ------------------------------------------------------------------------ [2010-02-07 14:11:39] dax at enst dot fr 1- Same version of PHP for Apache module and client command line : PHP 5.2.12 (cli) (built: Feb 6 2010 22:50:58) (DEBUG) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies 2- With your suggested script, the request do nothing appearant, no new page (always the previous page) and enters in an infinite timeout (no cpu). 3- In my mine, I don't suspect PHP, but I would like understand why this function doesn't work. I suspect the environment when I was building PHP, Apache, libapr* on this system. It works on an another server under Solaris9 with httpd-2.0.63 and php-5.2.9 and even on an other machine that I doesn't manage and I don't know architecture and OS but which is running httd-2.2.14 and php-5.2.12 like me. ------------------------------------------------------------------------ [2010-02-07 09:45:46] j...@php.net It just means crypt() returns NULL because some error happens. Is the command line PHP same version as the Apache module? And does this crash as well: <?php echo crypt("bar", "12"); ?> ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/50947 -- Edit this bug report at http://bugs.php.net/?id=50947&edit=1