execute an compiled c code in linux server

sam000
sam000 used Ask the Experts™
on
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


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

Open in new window

Comment
Watch Question

Do more with

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

Commented:
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

Author

Commented:
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.

Commented:
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

Author

Commented:
Thanx

Commented:
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