I've set up nginx and php on an ubuntu server 12.04. I have the following php file:
<?php echo "Hello "; echo passthru("cat /proc/meminfo"); echo "world. I am "; echo passthru("whoami"); ?>
This works completely fine when run from the command line, and php returns the text from /proc/meminfo. When run via nginx, however, I see this:
Hello world. I am www-data
Clearly, passthru is working. However, I can't seem to read anything in /proc. The permissions on /proc is dr-xr-xr-x, and I have confirmed that the www-data user that nginx and php run as can access that directory. I've turned on the php logging, and there are no error messages related to this.
Edit: Safe mode is turned off.