note 55325 added to function.mail

From: Date: Sat, 30 Jul 2005 17:46:14 +0000
Subject: note 55325 added to function.mail
Groups: php.notes 
Request: Send a blank email to php-notes+get-92771@lists.php.net to get a copy of this message
There is a problem with mail() in apache chroot I have spend 2 days in ktrace'ing and kdump'ing to figure out that the mail() function requires those things to work: number of .so libraries to work. I dont remember all of them but u can trace them out by running for example ktrace -f /tmp/ktrace php -f tf8.php and then kdump -f /tmp/ktrace | grep .so or by strings sh; strings php; strings sendmail; and mail() requires also ( for apache 1.3.33 and basicaly installed sendmail on freebsd): 1. /bin/sh 2. /usr/sbin/sendmail 3. existance and permission to read/write/execute by the user under which your apache is running in chroot to the directory /var/spool/mqueue commands: (hopefully i have not forgot anything): mkdir -p /usr/chroot/dev mkdir -p /usr/chroot/etc mkdir -p /usr/chroot/var/run mkdir -p /usr/chroot/lib mkdir -p /usr/chroot/usr/libexec mkdir -p /usr/chroot/libexec mkdir -p /usr/chroot/usr/local/lib/mysql mknod /usr/chroot/dev/null c 2 2 chown root:sys /usr/chroot/dev/null chmod 666 /usr/chroot/dev/null cp /lib/libcrypt.so.2 /usr/chroot/lib/ cp /usr/local/lib/mysql/libmysqlclient.so.14 /usr/chroot/usr/local/lib/mysql/ cp /usr/local/lib/libiconv.so.3 /usr/chroot/usr/local/lib/ cp /usr/local/lib/libfreetype.so.9 /usr/chroot/usr/local/lib/ cp /usr/local/lib/libpng.so.5 /usr/chroot/usr/local/lib/ cp /lib/libz.so.2 /usr/chroot/lib/ cp /usr/local/lib/libjpeg.so.9 /usr/chroot/usr/local/lib/ cp /lib/libm.so.3 /usr/chroot/lib/ cp /usr/local/lib/libxml2.so.5 /usr/chroot/usr/local/lib/ cp /lib/libc.so.5 /usr/chroot/lib/ cp /usr/libexec/ld-elf.so.1 /usr/chroot/usr/libexec/ cp /libexec/ld-elf.so.1 /usr/chroot/libexec/ cp /var/run/ld-elf.so.hints /usr/chroot/var/run/ mkdir /usr/chroot/sbin/ mkdir /usr/crhoot/usr/libexec/sendmail cp /usr/sbin/sendmail /usr/chroot/sbin/sendmail cp /usr/libexec/sendmail/sendmail /usr/chroot/sbin/sendmail cp /lib/libutil.so.4 /usr/chroot/lib/ mkdir /usr/sites/www/usr/lib/ cp /usr/lib/libwrap.so.3 /usr/chroot/usr/lib/ cp /usr/lib/libssl.so.3 /usr/chroot/usr/lib/ cp /lib/libcrypto.so.3 /usr/chroot/lib/ mkdir -p /usr/chroot/etc/mail mkdir -p /var/spool/mqueue/ chmod 777 /var/spool/mqueue/ cp /etc/mail/sendmail.cf /usr/chroot/mail/sendmail.cf mkdir -p /bin/ cp /bin/sh /usr/chroot/bin/sh cp /lib/libedit.so.4 /usr/chroot/lib/ cp /lib/libncurses.so.5 /usr/chroot/lib/ ---- Submitter IP: 195.222.161.50 ---- Manual Page -- http://www.php.net/manual/en/function.mail.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+55325 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55325&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55325&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55325&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55325&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55325&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55325&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+55325&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#92771) next »