★ wanayoo — archive 1999 http://webdeveloper.com/drweb/96Aug05-drwebsite.htmlNouvelle recherche | Portail wanayoo
Free Internet Technology info!

DR. WEBSITE

How to Fix CGI Scripts That Don't Work

Dear Dr. Website: I've made a link to a Perl script in my cgi-bin directory that's supposed to generate a random image. The script debugs and runs fine in the cgi-bin directory. However, when I call the Perl program from HTML, nothing happens. The problem can't be in the path name; the HTML document uses the exact same path that I am using for another Perl script that functions correctly. Is there any test for checking how a CGI script is called from inside a Web page?

While debugging your script is important, being able to execute it from your shell account's command line is only the first step toward ensuring that it will execute properly for your Web visitors.

You've been able to eliminate the file permissions set for your directory as a problem, since you say that you're already successfully calling another script in your cgi-bin directory. However, you should make sure that the script file itself is readable and executable by your server, as well as other files called by your script.

Since your image generator probably uses a database of graphics, make sure that database can be accessed properly. Improperly set file permissions are among the most common reasons why scripts don't work.

There still are a number of other factors that could be responsible for a script failing to execute within your Web page. You might get a better idea of what's going on by examining your server's error log for messages related to your script. For further troubleshooting, it's also always a good idea to call on your server's system administrator for help.

If you obtained your script from an online script resource, you may want to check the site for further detailed information or a FAQ list about how to install your script properly. You can find extensive CGI troubleshooting help online at Selena Sol's Public Domain CGI Script Archive and Resources Library, Matt's Script Archive Frequently Asked Questions page, and The Common Gateway Interface Frequently Asked Questions List.

Using PNG Format for Graphics

Dear Dr. Website: I saw an announcement about a new Web graphics package that said it offered support for the PNG format. How is PNG different from GIF or JPEG?

The Portable Network Graphics (PNG) format, pronounced "ping," emerged after a 1994 patent controversy over the GIF format appeared to threaten GIF's widespread use.

Although GIF is still with us, PNG format development is continuing. PNG has a lot of the same features as GIF, including indexed color palettes, interlacing and transparency (in GIF89a), and lossless compression (unlike JPEG, which sacrifices some image data in reducing file size).

It also has some features that GIF doesn't have, such as support for 48-bit color and an alpha channel for masks--and, as you might expect, its compression scheme is not patented. PNG also automatically adjusts graphics for gamma correction to compensate for cross-platform differences in brightness and contrast, which is a major bonus for designers of Web graphics.

It still remains to be seen whether PNG will become a popular Web graphics standard, given the widespread use of and browser support enjoyed by both GIF and JPEG. Not all image editors or Web browsers support the PNG format, though you might be surprised by how many do. The PNG Home Page has links to lists of image editors and Web browsers that can display PNG images.


Please Send your site design and development questions to webdoc@iw.com, or visit the Ask Dr. Website page.

Reprinted from Web Week, Volume 2, Issue 11, August 5, 1996 © internet.com Corporation All rights reserved. Keywords: graphics, html Date: 19960805

http://www.internet.com