Re: php exe from cli, but no web

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



wow, that was ez!

thanks a lot.

i also enabled php logging and checked my apache logs and it was as you said.

very cool.

my httpd process runs as apache, but I also did a whoami php script to very this.

thanks again stu, you helped out hugely!

- aurf
On Mar 31, 2009, at 3:38 PM, Stuart wrote:

2009/3/31  <aurfalien@xxxxxxxxx>:
Hi,

I won't be redundant by saying I'm new to PHP, so I won't :)

The following code works by doing;

php file.php

contents of file.php;

<?php
exec('/usr/bin/ssh user@host "nohup perl /perlscript&"');
?>

* I config'd this ssh user to not need a password, copied its key.

I place this file off of web root and point my browser to web root and type
the file name;

http://mywebroot/file.php

but it doesn't exe.

I'm not expecting to see a screen full, but I check to see if the perl
script runs on the remote host, and it doesn't.

All is well from a CLI.

Any suggestions are greatly appreciated,

PHP runs as a different user in a web server, usually nobody but it
depends on how your system has been set up. Given that it should be
obvious that the keys you've set up for the user you run it as from
the command line will not be used from the web server.

Hope that gives you enough info to solve the problem.

-Stuart

--
http://stut.net/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux