0

I am trying to execute the given command in php

exec("cd C:\xampp\htdocs\Dynamic-Form-Processing-with-PHP\JavaApplication1\src && java -classpath C:\org.json.jar;C:\mysql-connector-java-5.1.42-bin.jar;. javaapplication1.JavaApplication1")

It's just executing the first command i.e

cd C:\xampp\htdocs\Dynamic-Form-Processing-with-PHP\JavaApplication1\src 

Please can you give me a solution?

Thanks in advance!

Elydasian
  • 2,016
  • 5
  • 23
  • 41
  • I believe you might be interested in "proc-open" which has working directory as separate parameter. – Dmitry Zvorygin Jun 13 '17 at 12:36
  • i tried using proc-open but it does not execute https://stackoverflow.com/questions/3130677/how-to-run-multiple-commands-in-system-exec-or-shell-exec – Vishrudh _ Jun 13 '17 at 12:53
  • Does it work if you change the working directory with [`chdir`](http://php.net/manual/en/function.chdir.php) instead of `cd`, then [change it back](https://stackoverflow.com/questions/7925679/how-to-use-chdir-to-change-to-current-directory) afterwards? – Matt Raines May 24 '18 at 09:05

0 Answers0