1031今天到LINUX下部署CGI-BIN,结果发现就是不行,把一个最简单的PERL放上去
#!/usr/bin/perl
##!c:/perl/bin/Perl.exe
##
## printenv — demo CGI program which just prints its environment
##
print "Content-type: text/plain; charset=iso-8859-1\\n\\n";
foreach $var (sort(keys(%ENV))) &leftsign;
$val = $ENV&leftsign;$var&rightsign;;
$val =~ s&line;\\n&line;\\\\n&line;g;
$val =~ s&line;"&line;\\\\"&line;g;
print "$&leftsign;var&rightsign;=\\"$&leftsign;val&rightsign;\\"\\n";
&rightsign;
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
——————————————————————————–
Apache/2.0.46 (CentOS) Server at 192.168.9.243 Port 80
改为
#!/usr/bin/perl -w
就可以了
DOCUMENT_ROOT="/var/www/html"
GATEWAY_INTERFACE="CGI/1.1"
HTTP_ACCEPT="image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*"
HTTP_ACCEPT_ENCODING="gzip, deflate"
HTTP_ACCEPT_LANGUAGE="zh-cn"
HTTP_CONNECTION="Keep-Alive"
不过很奇怪~
-w enable many useful warnings (RECOMMENDED)
-W enable all warnings
应该和PERL没有什么关系
2005-10-28 晕倒,WIN下面好好的,LINUX就页面乱码;数据库数据乱码;SUBMIT不响应,什么问题都出来了;
修改:发现如下问题
1、大小写敏感问题,例如
include(\’ADOdb.inc.php\’); # 载入ADODB
需要修改
2、UTF-8和DB2312的问题
APACHE配置
#
# Specify a default charset for all pages sent out. This is
# always a good idea and opens the door for future internationalisation
# of your web site, should you ever want it. Specifying it as
# a default does little harm; as the standard dictates that a page
# is in iso-8859-1 (latin1) unless specified otherwise i.e. you
# are merely stating the obvious. There are also some security
# reasons in browsers, related to javascript and URL parsing
# which encourage you to always set a default char set.
#
AddDefaultCharset UTF-8
那么页面也要另存为 UTF-8 格式,否则页面、数据乱码
修改了这些后,发现一个问题,如果页面增加的内容,在LINUX MYSQL里面看是乱码,但是页面显示正常;如果在LINUX MYSQL直接INSERT,那么LINUX里面显示正常,但是页面显示乱码。
历史博文
- exe gui Console - 2009
- 20080207 Composite UI Application Block - 2008
- 20070607 winxp 蓝屏 0x000000F4 - 2007
- 0526 intel 双核 超线程 DualCore HyperThreading - 2006