NYCPHP Meetup

NYPHP.org

[nycphp-talk] Can't do PHP 'exec' for an rsync command via web server

Sasa Rakic - Gmail rakics at gmail.com
Sun Jun 24 10:21:13 EDT 2012


Hi David,

 

I do not have installed Linux on my computer, maybe this link should help:

 

https://www.centos.org/modules/newbb/viewtopic.php?topic_id=36419

 

Best Regards,

Sasa

 

From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of David Roth
Sent: Sunday, June 24, 2012 2:51 PM
To: NYPHP Talk
Subject: [nycphp-talk] Can't do PHP 'exec' for an rsync command via web
server

 

I'm developing a small utility web page to run on my own server which is
running CentOS 6.2 and Apache. PHP 5.3.3.

 

I tried using from PHP the exec function and also system, but after checking
the results nothing is returned. However, when I ran a little fragment of
this PHP code from the command line, it worked fine. But it won't execute
and return anything when run from a web page.

 

I have searched for an answer and have not been able to find a workable
solution to this. I looked and Safe Mode is off for PHP, as it is shipped
with CentOS. I've see forum postings about having Apache run as root, but
that's not secure. I was wondering if it was possible to put some specific
commands in sudoers like rsync for apache? That way maybe exec('sudo rsync
...'); would work without promoting for a password?

 

I'd greatly appreciate a solution from someone who has already been through
this. Thanks!

 

David Roth

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20120624/d818a09d/attachment.html>


More information about the talk mailing list