PHP exec not working for compiling on Windows 8 through Visual Studio 2012 Command Prompt -
Thank you for taking the time to help me today, what I hope is a simple question. I'm trying to use php exec () or any related PHP command to open the developer command prompt for Visual Studio 2013 and to compile a file and save output to a file on my local machine. I am using I'm working fine with it running on Windows, but I can not seem to work with PHP exec (). Here's how I have a command set currently.
$ cmd = 'C: \ Program Files (x86) \ Microsoft Visual Studio 12.0 \ Common7 \ Tools \ VsDevCmd.bat & amp; ; & Amp; CD C: \ wamp \ www \ csc424Try3 \ app \ Upload & amp; Amp; CL / AHSC original CPP & amp; Original & gt; & Gt; C: \ wamp \ www \ csc424Try3 \ app \ outputs \ output.txt ';
exec ($ cmd, $ result); As you can see, I am uniting commands together, allowing the first command prompt to open, the second change in the appropriate directory, the third prompt Runs the command to compile in, and the fourth output into a text file.
Any ideas where I am going wrong? I thought it was something to do with formatting, but perhaps by sticking the command together, the way PHP works on the system does not work.
You are forgetting the quotes around most of your arguments in the exec call string, which means that < things like code> program files will be seen as two separate things, not a single directory.
$ CMD = '"C: \ Program Files (x86) \ .... VsDevCmd.bat" & amp; Amp; e.t.c...'; ^ - ^ - In
is required, as you are trying to execute a program called
C: \ Program , such as some additional arguments With
files (x86) \ ..... .
Comments
Post a Comment