In the context of a larger effort, I've run across a particular issue that is baffling me.
On Mac OS X 10.6.7, using the system provided Apache and PHP, I have created a simple
HelloWorld.php script that, no surprise, just prints
Hello, World! and nothing else.
Works fine if I execute it as
However, if I:
sudo su su _www php helloworld.php
It emits nothing;
php returns pretty much immediately with no signs of execution.
Where have I gone off the rails (and, more importantly, what diagnostic information should I be gathering to help deduce the issue)?
bash-3.2$ls -alF foo.php -rw-r--r-- 1 _www _www 37 Apr 4 21:08 foo.php bash-3.2$ ls -dalF . drwxr-xr-x 56 _www _www 1904 Apr 4 21:08 ./ bash-3.2$ whoami bbum bash-3.2$ php foo.php Hello, World! bash-3.2$ sudo sh sh-3.2# php foo.php Hello, World! sh-3.2# su _www php foo.php sh-3.2#
If I copy
foo.php to my Webserver's documents root, it works. As it does in my user's docroot; it executes via the webserver just fine, regardless of location.
su _www php -v fails to spew anything. Something fishy here.
Derp. The _www user is just busted; no shell. Screws up even the simplest of commands when attempted from the shell.