Last active
April 12, 2022 19:48
-
-
Save codeZoner/6545d76cc0b5b80d9d8e76fb3a60cd1d to your computer and use it in GitHub Desktop.
Revisions
-
Fahim Hossain revised this gist
Jul 29, 2017 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,6 +3,7 @@ //Ref: https://stackoverflow.com/questions/11052162/run-bash-command-from-php#answer-11052453 $old_path = getcwd(); chdir('/path/to/file'); //make sure to make the shell file executeable first before running the shell_exec function $output = shell_exec('./shell-script.sh'); chdir($old_path); -
Fahim Hossain revised this gist
Jul 29, 2017 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ <?php // chdir to the correct directory before calling the script //Ref: https://stackoverflow.com/questions/11052162/run-bash-command-from-php#answer-11052453 $old_path = getcwd(); chdir('/path/to/file'); $output = shell_exec('./shell-script.sh'); -
Fahim Hossain created this gist
Jul 29, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ <?php $old_path = getcwd(); chdir('/path/to/file'); $output = shell_exec('./shell-script.sh'); chdir($old_path); echo $output; ?> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ #!/bin/bash cd /path/to/git/folder && git pull origin branch_name