Jump to content

krishnanunni

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

krishnanunni's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks all for replies. I got the solution, as it was because, in Apache user context, the XServer is not available. So I just executed it using xvfb-run. It worked fine.
  2. <?php $htmlcontent=$_POST['source']; $pngname=$_POST['pngname']; $height=$_POST['height']; $width=$_POST['width']; if(!isset($htmlcontent)){die('No HTML Cannot Proceed');} $sourcefile='/var/www/CutyCapt/Sources/sourcefile.html'; $pngfile='/var/www/CutyCapt/Captures/'.$pngname; $hyperlink='http://my.domain.com/CutyCapt/Captures/'.$pngname; $htmlfile=fopen($sourcefile,'w') or die('Source Initialization Failed'); fwrite($htmlfile,$htmlcontent); fclose($htmlfile); if(!file_exists($sourcefile)){die('Parser Source Does not Exist! Operation aborted');} //Generate SnapShot shell_exec('/usr/bin/CutyCapt --html='.$sourcefile.' --out='.$pngfile.' --min-height='.$height.' --min-width='.$width); //shell_exec('/usr/bin/CutyCapt --html=source.htm --out=test.png --min-height=600 --min-width=800'); if(!file_exists($pngfile)){die('Image Not Created');} else echo $hyperlink; ?> This is my code. This can work fine, when i try from terminal, with php interpreter the script works fine. But when it comes to webserver, it wont execute at all. All libs and CutyCapt resides in /usr/bin/ only. Any suggestions?
  3. Hi all, I am a newbie to PHP. I'm trying to execute a program from my PHP script by calling the exec() function of PHP. It works fine when i try it from command line, or execute the script in command line. But when i call it from a php script in my apache, it does nothing. No errors are thrown. What i get in return is only an empty array. i'm using Ubuntu 11.10 and Apache 2.2 with PHP 5.3.3 thanks for helping me.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.