0
votes
5answers
198 views

How to run su from PHP launched on Apache? [closed]

I tried to run su command with PHP shell_exec function. At first I tried: <?php echo(shell_exec('echo \'password\' | su user -c \'whoami\' 2>&1;')); ?> and I got: su: must be run from ...
0
votes
1answer
682 views

Installed PHP 5.4 via OS X binary, but `php` in terminal still uses 5.3 [closed]

I used a nice one-line command to install PHP 5.4 Mac OS X Lion, from php-osx.liip.ch. This is working perfectly in Apache – my local sites are now using PHP 5.4. But when I run php -v from the ...
1
vote
2answers
532 views

Run commands in PHP with different user

I would like to be able to run PHP commands, in system-function exec or whatever, but with a different user then www-data. OS: Ubuntu Server 10.10 Web Server: Apache2 I've searched for answers a ...
0
votes
1answer
3k views

How can I mount a remote volume with 777 permissions for all users?

I want users to be able to upload files to a central file server via my PHP script. I mounted the file server's shared volume using this command: sudo mount -t cifs //192.168.1.8/share local_dir -o ...
5
votes
11answers
12k views

How to watch logs in real time via Terminal?

This is a basic question - in the movie "The Social Network" there are several scenes when the young Facebook staff is watching the PHP/Apache server logs on in their TERMINAL in real time. I'm ...
2
votes
4answers
2k views

crontab - how to create in Terminal?

I'm trying to run a scheduled task on my shared Linux server using the crontab via Terminal on my Mac. I can login to my ssh OK, and can view directories etc with ease. I try and create/edit my ...