Ask a Question related to PERL Modules, Design and Development.
-
Peroli #1
GD demo cgi script works on command line but not on webserver.
Hi all,
I recently installed GD version 2.34. The installation process went
well, except that it said, it cannot find -liconv library. It also said
its harmless.
I executed the demo script GD-2.34/demo/shapes.pl and it worked
well.
Then I executed GD-2.34/demo/gd_example.cgi, where i changed the
shebang line to the right version of perl and it failed. The error is
as follows:
#####################################
Can't load
'/apps/yell/perl/sun4/5.8.7/lib/site_perl/5.8.7/sun4-solaris//auto/GD/GD.so'
for module GD: ld.so.1: /apps/yell/perl/sun4/5.8.7/bin/perl: fatal:
libjpeg.so.62: open failed: No such file or directory at
/apps/yell/perl/sun4/5.8.7/lib/5.8.7/sun4-solaris/DynaLoader.pm line
230.
at /opt/apache/socdb-tii/cgi-bin/gd_example.cgi line 3
Compilation failed in require at
/opt/apache/socdb-tii/cgi-bin/gd_example.cgi line 3.
BEGIN failed--compilation aborted at
/opt/apache/socdb-tii/cgi-bin/gd_example.cgi line 3.
[Wed Jun 14 14:12:12 2006] [error] [client 172.24.170.192] Premature
end of script headers: /opt/apache/socdb-tii/cgi-bin/gd_example.cgi
#####################################
source file:
#####################################
#!/apps/yell/perl/sun4/5.8.7/bin/perl
use GD;
print "Content-type: image/png\n\n";
# create a new image
$im = new GD::Image(100,100);
# allocate some colors
$white = $im->colorAllocate(255,255,255);
$black = $im->colorAllocate(0,0,0);
$red = $im->colorAllocate(255,0,0);
$blue = $im->colorAllocate(0,0,255);
# make the background transparent and interlaced
$im->transparent($white);
$im->interlaced('true');
# Put a black frame around the picture
$im->rectangle(0,0,99,99,$black);
# Draw a blue oval
$im->arc(50,50,95,75,0,360,$blue);
# And fill it with red
$im->fill(50,50,$red);
binmode STDOUT;
# Convert the image to PNG and print it on standard output
print $im->png();
#########################################
Running it on the command line works fine. I don't know why it fails
while apache is executing it.
-- Peroli Sivaprakasam
Peroli Guest
-
#38923 [NEW]: ODBC works through command line but not Apache
From: matthew dot berry at wolseley dot co dot uk Operating system: Unix PHP version: 5.1.6 PHP Bug Type: ODBC related Bug... -
My Script to run a Command-Line from ASP does not work.
Hi, My Script to run a Command-Line from ASP does not work. No errors are returned either. It is on IIS. The directory where the script exists is... -
My Script to run a Command-Line from ASP does not work
Hi, My Script to run a Command-Line from ASP does not work. No errors are returned either. It is on IIS. The directory where the script exists is... -
[PHP] execute command line script from browser
Is there a way to execute a command line php script from a browser by, say clicking a button and then having the browser let go and let the script... -
execute command line script from browser
Is there a way to execute a command line php script from a browser by, say clicking a button and then having the browser let go and let the script... -
Sherm Pendley #2
Re: GD demo cgi script works on command line but not on webserver.
"Peroli" <peroli@gmail.com> writes:
Is your server configured to run CGI scripts in a chroot "jail"? If so, then> Hi all,
> I recently installed GD version 2.34. The installation process went
> well, except that it said, it cannot find -liconv library. It also said
> its harmless.
> I executed the demo script GD-2.34/demo/shapes.pl and it worked
> well.
> Then I executed GD-2.34/demo/gd_example.cgi, where i changed the
> shebang line to the right version of perl and it failed. The error is
> as follows:
>
> #####################################
> Can't load
> '/apps/yell/perl/sun4/5.8.7/lib/site_perl/5.8.7/sun4-solaris//auto/GD/GD.so'
> for module GD: ld.so.1: /apps/yell/perl/sun4/5.8.7/bin/perl: fatal:
> libjpeg.so.62: open failed: No such file or directory at
> /apps/yell/perl/sun4/5.8.7/lib/5.8.7/sun4-solaris/DynaLoader.pm line
> 230.
libjpeg may not be visible from inside the jail, even though it's visible
from your normal login environment.
sherm--
--
Cocoa programming in Perl: [url]http://camelbones.sourceforge.net[/url]
Hire me! My resume: [url]http://www.dot-app.org[/url]
Sherm Pendley Guest
-
Peroli #3
Re: GD demo cgi script works on command line but not on webserver.
>
Thanks, sherm. That was the problem. Apache doesn't see this> Is your server configured to run CGI scripts in a chroot "jail"? If so, then
> libjpeg may not be visible from inside the jail, even though it's visible
> from your normal login environment.
>
> sherm--
>
directory at all. Problem solved.
-- Peroli Sivaprakasam
Peroli Guest



Reply With Quote

