I am trying to work out why some processes work when called from PHP on my localhost and why others will not work.
In my PHP script, I have this:
In mycprog.c, it does this: (literally - this is all it does)
On my PHP page, when I click the associated button, I get on my page:
Where does this RC=6 come from? Is this Apache? PHP?
I've also tried in PHP:
and it does not work either. RC=6.
Running the C program standalone, it works fine.
Running open from Terminal kicks off Sketchup just fine.
Running open from a Ruby script, kicks off SketchUp just fine.
I've tried system(), exec(), passthru() from PHP, and all give the same error.
Thanks, Todd
In my PHP script, I have this:
PHP:
$last_line = system("./mycprog", $result) ;
echo "last_line = " . $last_line . "<br/>" ;
echo "result = " . $result ;
In mycprog.c, it does this: (literally - this is all it does)
Code:
#include <stdio.h>
int main (int argc, const char * argv[]) {
printf("Hello from Compiled C code!\n");
return system("open -a \"sketchup 5\"") ;
}
On my PHP page, when I click the associated button, I get on my page:
Hello from Compiled C code! last_line =
result = 6
Where does this RC=6 come from? Is this Apache? PHP?
I've also tried in PHP:
PHP:
$result = exec('open -a "sketchup 5"') ;
and it does not work either. RC=6.
Running the C program standalone, it works fine.
Running open from Terminal kicks off Sketchup just fine.
Running open from a Ruby script, kicks off SketchUp just fine.
I've tried system(), exec(), passthru() from PHP, and all give the same error.
Thanks, Todd