When I run test1.pl from terminal it works. When I type the commands directly into terminal they work. When I call the script from php all I get is "hello world".
test1.pl:
#!/usr/bin/perl
exec "convert image.pdf image.jpg";
exec "gs -q -sDEVICE=jpeg -dBATCH -dNOPAUSE -dFirstPage=1 -dLastPage=1 -sOutputFile=image.jpg image.pdf 2>&1";
print "hello world";
tester.php:
<html>
<head>
<title>pdf to jpg converter</title>
</head>
<body>
<?php
//passthru("convert image.pdg image.jpg");
//passthru("gs -q -sDEVICE=jpeg -dBATCH -dNOPAUSE -dFirstPage=1 -dLastPage=1 -sOutputFile=image.jpg image.pdf 2>&1");
passthru('perl test1.pl');
//$result=passthru("perl test1.pl");
//virtual("perl test1.pl");
?>
</body>
</html>
also tried:
<html>
<head>
<title>pdf to jpg converter</title>
</head>
<body>
<?php
$perl = new Perl();
$perl->eval('print "Hello from perl!
"');
print "Bye!
";
?>
</body>
</html>
which produced this error:
Fatal error: Class 'Perl' not found in /Library/Tenon/WebServer/WebSites/www.website.net/beta_web/beta_apps/test/tester.php on line 12