Hello,
My problem is with FastCGI php5 in a chrooted environment. In chroot the
binary refuses to find the shared libs like mysql.so (but the binary
itself works).
Whenever I disable chroot (-u) the binary includes the shared libs
without any problems.
Pointing to a different (relative or absolute) path in php.in
(extension_dir) does not help.
The dl() function (which allows loadiing extensions within scripts) does
not work either, even though it can find the mysql.so if placed in the
same dir as the script calling it.
All the required files (ldd) are in the chroot environment, there are no
signs of anything obvious missing.
By temporarily placing ktrace in the chroot and making it executable by
www I have managed to get a trace from the actual process as ran by www.
Reading that however does not give *me* any clues as to what could be
the problem:
2608 php5-fastcgi CALL open(0x4940d000,0,0x6c)
2608 php5-fastcgi NAMI "/lib/php/modules/mysql.so"
2608 php5-fastcgi RET open 5
2608 php5-fastcgi CALL fstat(0x5,0x7f7ffffe2170)
2608 php5-fastcgi RET fstat 0
<snip>
2608 php5-fastcgi RET sigprocmask -65793/0xfffefeff
2608 php5-fastcgi CALL write(0x2,0x7f7ffffe23c0,0x8a)
2608 php5-fastcgi GIO fd 2 wrote 138 bytes
"PHP Warning: PHP Startup: Unable to load dynamic library
'/lib/php/modules/mysql.so' - Cannot load specified object in Unknown on
line 0
"
2608 php5-fastcgi RET write 138/0x8a
The php warning above is what I get back in the /var/www/logs/error_log.
Errors are the same if I specify '/var/www/lib/php/modules/' - it does
not matter.
I would really like to get this working in a chroot but just don't know
what I can/should do next.
I will GLADLY include complete traces (it's long!) or other desired info
if someone thinks it will help.
General help as to what to look for / how to debug more / where to get
answers instead is also very much appreciated.
Thank you,
Matt
Matt schreef:
[Wed Jul 11 18:34:07 2007] [warn] FastCGI: (dynamic) server
"/cgi-bin/10.0.0.64/php5.fcgi" (uid 1000, gid 1000) started (pid 20781)
PHP Warning: PHP Startup: Unable to load dynamic library
'/var/www/lib/php/modules/mysql.so' - File not found in Unknown on line 0