I have an .exe file written in C/C++ that I need to be able to run on my web server. When this .exe is run from the run line on my computer, it receives an input like this:
and the .exe then simply creates a file named Test.txt in the same folder as the .exe.
I need to replicate this behaviour on my web server (Linux 64-bit), so I've placed the .exe in a folder (folder2) and enabled all permissions for this folder, and I'm trying to call the file in PHP using exec() as follows:
exec("/usr/bin/php5 folder2/filename.exe -oTest.txt > outputfile.txt");
When I run this PHP file, I'm hoping for the .exe to create a file named Test.txt in folder2 on the server, but at the moment it's not. The file outputfile.txt is being created in the PHP file's folder, and it reads as follows:
Warning: Unexpected character in input: '' (ASCII=5) state=1 in /home/websitename/public_html/folder1/folder2/filename.exe on line 704
Parse error: syntax error, unexpected T_STRING in /home/websitename/public_html/folder1/folder2/filename.exe on line 704
Is what I'm trying to do possible, and if so, am I way off track with the above?
Thanks in advance!