run a c++ command line app via php server side

This is a bit confusing to explain but, the idea is that I could go to a webpage that is going to execute a app on the server. I have tried this with

<?php exec("./app"); ?>

but im not getting any results - It may be a server permission problem, but im not getting any error reports. Basically im starting simple, just doing a “hello world” and hoping to build a xcode template for OF to run the app on server side.

Has anyone tried this worked on it - have suggestions.

It should be cool!

T

Yeah, you’ll definitely have to make sure the PHP runtime has permissions to run the app. You could just chmod og=x or run ls -l to see who owns the app. I’ve never executed an OF app, but I’ve run other stuff from PHP and sometimes getting the permissions right is a pain.

Have you tried this? PHP won’t automatically print the output unless you tell it to.

<?php $output = exec('./app'); echo $output; ?>

If it still doesn’t work, the way that I usually change permissions on my web server is by FTPing in with Filezilla, right clicking on the file that I want to change, then clicking file attributes. Then you can either change the number at the bottom to 755 or just use the checkboxes to change it to whatever.