Edit report at http://bugs.php.net/bug.php?id=50947&edit=1

 ID:                 50947
 User updated by:    dax at enst dot fr
 Reported by:        dax at enst dot fr
 Summary:            crypt() crashes with Apache module but not on
                     command line
 Status:             Assigned
 Type:               Bug
 Package:            Apache2 related
 Operating System:   Solaris10
 PHP Version:        5.2.12
 Assigned To:        dsp
 Block user comment: N

 New Comment:

The same bug occured with php-5.2.13 and still with php-5.2.14

not with php-5.3.2 and 5.3.3


Previous Comments:
------------------------------------------------------------------------
[2010-02-17 01:13:57] paj...@php.net

Hm no, can't be the same bug. 5.2.12 uses Solaris implementation of
crypt. David, can you look at it pls?

------------------------------------------------------------------------
[2010-02-16 23:22:42] paj...@php.net

Duplicate of #51059

------------------------------------------------------------------------
[2010-02-08 15:40:10] dax at enst dot fr

# change LD_LIBRARY_PATH for CLI to be thes same as Apache

echo $LD_LIBRARY_PATH 

/usr/local/apache22/lib:/usr/local/apache22/modules:/usr/local/apr/lib:/usr/local/gcc3/lib:/usr/local/lib



is now le same as apache running.



ldd /usr/local/apache22/modules/libphp5.so |sort >ldd-libphp

ldd /usr/local/apache22/bin/php |sort >ldd-cmdphp

diff ldd-cmdphp ldd-libphp

<nothing> 



CLI is running under root

Apache is running under nobody (as usual)



Same environment about LD_LIBRARY_PATH



mode CLI: both scripts work

mode apache:

   cryptok.php (with salt) works

   cryptbad.php (without salt) crashes

------------------------------------------------------------------------
[2010-02-08 15:10:28] johan...@php.net

Can you try using the same LD_LIBRARY_PATH when running CLI as oyur
doing with Apache? Can you check whether ldd reports other libs when
using CLI with this path?



Areyou running CLI and apache as the same user from the same environment
or are there different users/environments used?

------------------------------------------------------------------------
[2010-02-08 14:20:54] dax at enst dot fr

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/

------------------------------------------------------------------------


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/bug.php?id=50947


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=50947&edit=1

Reply via email to