Open Source Web Development with LAMP Using Linux, Apache, MySQL, Perl, and PHP [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Open Source Web Development with LAMP Using Linux, Apache, MySQL, Perl, and PHP [Electronic resources] - نسخه متنی

James Lee, Brent Ware

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید










7.4 What Can Go Wrong?


Many of the errors that can occur with CGI programs produce a page displayed in the browser as shown in Figure 7.6. Pretty helpful, huh?


Figure 7.6. Server error


There could be many causes of this condition. The following are some common things to check.


The script is syntactically incorrect (try perl -c script.cgi).


The first line is not #!/usr/bin/perl.


There are incorrect file permissions (try chmod a+rx script.cgi or ls-l).


There are incorrect directory permissions (be sure the cgi-bin directory has 755 permissions).



You can also run the program from the command line:


$ ./error.cgi
syntax error at ./error.cgi line 6, near ") chomp"
Execution of ./error.cgi aborted due to compilation errors.

A clue! The script has a syntax error near line 6.

When all else fails, check the error log file /var/log/httpd/error_log. You might see a line that looks like this:


syntax error at /var/www/cgi-bin/error.cgi line 6, near ") chomp"
Execution of /var/www/cgi-bin/error.cgi aborted due to compilation
errors. [Fri Mar 25 10:23:17 2002] [error] [client 127.0.0.1] Premature
end of script headers: /var/www/cgi-bin/error.cgi

Aha! Another clue pointing to line 6!


/ 136