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

2012-06-24 Thread David Roth
I'm happy to report this is working now! To recap the adventure for those of you who arrived late...:-) CentOS 6.2. as shipped with PHP 5.3.3. Out of the box I couldn't execute a PHP function (exec or system) to do an rsync with a remote host. The reason was that Apache runs as user apache and do

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

2012-06-24 Thread Hans Zaunere
> # grep apache /etc/passwd > apache:x:48:48:Apache:/var/www:/sbin/nologin > > You suggesting I change apache to just another user, like this? > apache:x:48:48:Apache:/var/www:/bin/bash Yes, though I'd make its own home directory, /home/apache, and give appropriate rights as needed to the doc roo

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

2012-06-24 Thread David Roth
# grep apache /etc/passwd apache:x:48:48:Apache:/var/www:/sbin/nologin You suggesting I change apache to just another user, like this? apache:x:48:48:Apache:/var/www:/bin/bash Maybe generate apache's own set of ssh keys to access the remote server for rsync? Thanks, David Roth On Sun, Jun 24,

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

2012-06-24 Thread Hans Zaunere
Often the Apache user isn't created with a home directory etc. Check the passwd file to ensure its a full user with a home and shell? Security is another question :) On Jun 24, 2012 6:52 PM, "David Roth" wrote: > > > On Sun, Jun 24, 2012 at 11:50 AM, Hans Zaunere wrote: > >> > I'm developing a

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

2012-06-24 Thread David Roth
On Sun, Jun 24, 2012 at 11:50 AM, Hans Zaunere wrote: > > 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 return

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

2012-06-24 Thread Rolan Yang
try specifying the entire path to /usr/bin/rsync in your exec command line. ~Rolan On 6/24/2012 8:51 AM, David Roth wrote: 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

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

2012-06-24 Thread Hans Zaunere
> 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 th

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

2012-06-24 Thread Sasa Rakic - Gmail
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-boun...@lists.nyphp.org [mailto:talk-boun...@lists.nyphp.org] On Behalf Of David Roth Sent: Sunday, J

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

2012-06-24 Thread David Roth
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 l