0

I want to run gradlew using PHP. What i have tried is using exec(), shell_exec, or passthru. I executed those commands inside a PHP script named "build.php". I tried calling the script from a browser or curl and got this error

Exception in thread "main" java.lang.RuntimeException: java.io.FileNotFoundException: /var/www/.gradle/wrapper/dists/gradle-2.2.1-all/6dibv5rcnnqlfbq9klf8imrndn/gradle-2.2.1-all.zip.lck (No such file or directory)

However when i called it from command line using php build.php, it worked very well. I

I need the gradlew command to be executed through user action from browser. My question: what might cause this error and how to get rid of it?

Thank you very much.

M Rijalul Kahfi
  • 1,460
  • 3
  • 22
  • 42

1 Answers1

0

That's because you don't have a folder named .gradle in /var/www Create the folder and give a+rw permissions:

mkdir /var/www/.gradle
chmod a+rw /var/www/.gradle
Fox
  • 2,513
  • 2
  • 20
  • 24