0

i have created a bash script file named as shellscript.sh.Which copy content of one file add into host file.This is working when i run this manually using command

sh shellscript.sh

I want to exicute this script from php function.anytone know how to execute.Owner of this file is ubuntu:ubuntu.

I am using dedicated server Amazon ec2 .So have root access.php owned bu another user and file owner is ubuntu.

6
  • 2
    There are several PHP functions for executing commands: shell_exec, exec, and system. Commented May 25, 2017 at 5:57
  • i have tried shell_exec but it not executed file. Commented May 25, 2017 at 6:00
  • Try using the full pathname of the script. Commented May 25, 2017 at 6:01
  • Unless you are running your own web server, it is possible that shell execution has been disabled by your hosting provider. Commented May 25, 2017 at 6:05
  • ohh,@ fortune thanks for point me there.your suggested answer worked with some file permission changes.Thanks Commented May 25, 2017 at 6:06

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.