POST data is lost on PHP CGI after shmat() failed. [4.0.5, Linux]
| From: | Steven Haryanto | Date: | Fri, 13 Jul 2001 19:00:45 +0000 |
| Subject: | POST data is lost on PHP CGI after shmat() failed. [4.0.5, Linux] | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-57787@lists.php.net to get a copy of this message | ||
I have two CGI PHP installation on my Linux system. One of them is
a vanilla build (all defaults except --prefix and
--with-config-file-path, and the other is built with the .spec file
from rpms.arvin.dk).
POST method does not work with the arvin PHP CGI binary, while it
works ok with the vanilla one and with other non-PHP CGI scripts.
After spending a full day focusing on environment variables and
Apache configuration (which is a custom one), I run strace on a
simple script using the arvin PHP. Here's the partial output:
...
shmget(IPC_PRIVATE, 33554432, IPC_CREAT|0x180|0600) = 5079044
shmat(5079044, 0, 0) = -1 ENOMEM (Cannot allocate memory)
shmctl(5079044, IPC_RMID, 0) = 0
close(0) = 0
unlink("/tmp/session_mm.sem") = -1 ENOENT (No such file or directory)
brk(0x8155000) = 0x8155000
brk(0x8156000) = 0x8156000
open("./php.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/php.ini", O_RDONLY) = 0
getcwd("/path/to/script", 4095) = 46
lstat("/etc", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/etc/php.ini", {st_mode=S_IFREG|0644, st_size=20430, ...}) = 0
brk(0x815b000) = 0x815b000 ioctl(0, TCGETS, 0xbffff828) = -1 ENOTTY (Inappropriate ioctl for device)read(0, "[PHP]\n\n;;;;;;;;;;;;;;;;;;;\n; Abo"..., 8192) = 8192 read(0, "\t; C, E & S respectively, often "..., 8192) = 8192
brk(0x815c000) = 0x815c000read(0, "t_password\t\t=\t\t; default passwor"..., 8192) = 4046
read(0, "", 4146) = 0... I am not sure what line of code does the close(0) on the fourth line shown above, though it has something to do with the MM library, since after I rebuild PHP --without-mm, all is well. Could someone shed a light on this? Regards, Steve