execute an compiled c code in linux server

sam000 used Ask the Experts™
Hi all,

In linux server from php script i want to run a compiled c code. I could run from localhost but after uploading, i cannot run it. Please help me

echo("Schedule Started"); 
echo  exec('./buildTournScheduler');
echo "<br>";
echo " Scheduling Done";

Open in new window

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Is the executable on the server.  Also, are there possibly any shared libraries or other items which may not be present on the server.  

Try running the compiled program from the server command line and see if it throws any errors.

  - flub


I am a newbie and wanna know

How to run the compiled program from the server command line so that I can see if it throws any errors.

First, you need command line access.  Then, if you are in the directory where the compiled program is, assuming the name of the program is "myprogram", you can do the following:

$ ./myprogram

Make sure that you proceed your program name with the "./"

Also, you may need to make sure that the program is executable.  If not, you can do something like:

$  chmod u+x myprogram

HTH - flub



Question answered?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial