I'm working on a php application that pulls github repositories to the server. Github webhooks call the php files.
I want to execute a cmd command using php. I assume I need apache permissions but I don't know how to give them.
The php code below creates an mkdir.bat
and a gitclone.bat
and runs them. The mkdir
runs successfully, it creates an empty folder, but the gitclone
doesn't create any folders or files. When I run the gitclone
manually it does create folders and files.
file_put_contents("mkdir.bat", "mkdir test");
exec("mkdir.bat");
file_put_contents("gitclone.bat", "git clone https://github.com/gutyina700/WPTG.git");
exec("gitclone.bat");