首页 Soft PlugIn RAN乱 Dev开发 Info资料 English WAP 留言 登陆 注册
-
Posted by Yippee | 评论(0) | 引用(0) | 阅读1974次
PHP PERL MYSQL LINUX 部署 乱码

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))) {
    $val = $ENV{ $var };
    $val =~ s|\n|\\n|g;
    $val =~ s|"|\\"|g;
    print "${ var }=\"${ val }\"\n";
}
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 dot

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里面显示正常,但是页面显示乱码。


字体:

Permanant URI永久地址 http://www.shengfang.org/blog/p/phpperllinuxinst.php
Trackback URI引用地址 http://www.shengfang.org/blog/tb.php?tb_id=1131402897

2005年11月8日06:34星期二  [Dev开发] 追踪此文的RSS
提示:
此文还没有评论。

称呼:    登陆   注册
   不注册,但记住我的信息
邮件:
(非必须)
评论: [UBB代码帮助]
粗体 斜体 下划线 链接 水平线 引用



验证码: 请输入你看见的数字
关闭UBB      提交时自动将内容复制到剪贴板

公告
Fire and Motion!

统计信息
[Yippee]||[统计]||日志:1790
在线: 16||用户: 2563 [列表]
今日:564||到访:2682203
Rss:841940||评论:1585

最新日志

最新评论

友情链接

日历

最新引用

搜索

归档

杂项
Get RSS Feed (Version 2.0)
Get Atom Feed (Version 0.3)
编码:  UTF-8