-1

Few months ago I make small c++ console application on Windows. I need to run exe file over the browser. I use exec php function and everything works fine. Now I trying to do same thing on Linux so that I can put executable file on Linux web server. My linux executable file (inpainting) work when is called from console. But I can't run executable file over exec function.

xampp windows: - this works, i get my results.

<?php
$imagename = $_GET['imagename'];
exec('inpainting.exe' .$imagename); 
echo "<img src=\"./images/img-uploads/ob_img$imagename.jpg\" />";
?>

But how to run it on xampp linux? I try this and results is blank screen.

<?php
$imagename = $_GET['imagename'];
exec('inpainting' .$imagename); 
echo "<img src=\"./images/img-uploads/ob_img$imagename.jpg\"/>";
?>

And I try few more things, but nothing happens. Some people say that exec is bad thing, if someone have other better solution - please share with me. Any ideas? Tnx

I allow all permissions on working folders. I run xampp 1.7.3a on Ubuntu 12.4

Rile
  • 43
  • 3
  • 8

1 Answers1

0

This may help, I added the second parameter then did a dump, it should display all the output from the command that was run.

<?php
$imagename = $_GET['imagename'];
exec('inpainting ' .$imagename, $opt); 
var_dump($opt);
echo "<img src=\"./images/img-uploads/ob_img$imagename.jpg\"/>";
Get Off My Lawn
  • 34,175
  • 38
  • 176
  • 338