1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

Running PHP plugin as root user not working in Linux

Discussion in 'Community' started by Dinesha, Oct 9, 2019.

  1. Dinesha

    Dinesha New Member

    Level: Community
    Hi All,

    I am running php plugin in on top of form. Below is my PHP code.
    exec('/usr/bin/sudo cp -avr /tmp/test.txt /etc/systemd/system/test.txt');

    Above PHP code is working when I am running in putty. But it's not working with PHP form plugin.

    In the above PHP code, I am trying to copy and paste file from one folder to another folder as sudo.

    Please help me how can I run my PHP code.

    Thanks in Advance...
    Last edited: Oct 9, 2019
  2. troester

    troester Well-Known Member Staff Member

    Level: Community
    This is nothing about Fabrik but your server and Linux user setup.
  3. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Unless you've set the user your web service runs as to have passwordless sudo (which would be a mind bogglingly bad idea), that's not going to work.

    -- hugh

Share This Page