Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

PHP Program Execution


ghost's Avatar
0 0

Ok, I've googled this and googled this so here's my problem:

I've got, sitting in the other room, a box that's running Mandriva Free 2007 spring I have apache 2.0, php5, and MySQL set up on it. I've written a small C++ program which will decapitalize the names of files in a specified directory (this was written for someone else who has lots of files sent to him all capitalized and he needs them decapped). So anyway here is the php problem, everything works fine, but I can't get php to run the program for me. It's not that I don't know the commands it just seems to lock up when I try to use them to open the program. I've tried shell_exec("./decapFile"); exec("./decapFile"); echo ./decapFile; and so on and so on… all with the same results, the browser just looks as though it's loading, and never stops loading and then when I close the browser my system runs slow for a couple of minutes. The program can be run from the shell just fine I simply type ./decapFile into konsole and it runs the program, which like I said is small so it doesn't even take it a second to complete. Anyone know what I'm doing wrong?

Also when I used g++ to compile the c++ program it gives me the error no new line at the end of the file. So I tried to compile it on my windows machine and got the same error, then I went back and put a ';' at the end and it fixed the problem on windows… however I'm still getting the error in linux. Anyone know about this? Thanks in advanced, Howie