facebook twitter hatena line email

「Linux/perlインストール」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(defined(%hash) is deprecated at ./jcode.pl エラー)
 
(同じ利用者による、間の16版が非表示)
行2: 行2:
 
  yum install perl
 
  yum install perl
 
  /usr/bin/perl -v
 
  /usr/bin/perl -v
 +
 +
==mod_cgi追加==
 +
$ sudo vi /etc/httpd/conf/httpd.conf
 +
 +
LoadModule cgi_module modules/mod_cgi.so
 +
参考:https://www.javadrive.jp/apache/php/index5.html
  
 
==apacheでcgiを動かす==
 
==apacheでcgiを動かす==
*httpd.conf
+
*/etc/httpd/conf/httpd.conf
 
  #AddHandler cgi-script .cgi
 
  #AddHandler cgi-script .cgi
 
   ↓
 
   ↓
行22: 行28:
 
  print "Hello, World.";
 
  print "Hello, World.";
  
==注意==
+
==AH01215: (2)No such file or directory: exec ofエラー==
 
windowsで作ったものは文末にCR+LF(^M)がつくのでLFのみにしないとerrorとなる
 
windowsで作ったものは文末にCR+LF(^M)がつくのでLFのみにしないとerrorとなる
 
^Mを削除するにはviで開いて"%s/^M//g"とする^Mは[Ctrl+v]を押したまま[Ctrl+m]で入力
 
^Mを削除するにはviで開いて"%s/^M//g"とする^Mは[Ctrl+v]を押したまま[Ctrl+m]で入力
 +
 +
参考:https://mgng.mugbum.info/664
 +
 +
[[linux/vimメモ]] [ショートカット]
 +
 +
==Use of "do" to call subroutines is deprecated at ./jcode.plエラー==
 +
エラーメッセージ
 +
AH01215: Use of "do" to call subroutines is deprecated at ./jcode.pl line 328.
 +
 +
以下からjacode.plをDL
 +
https://d-wave.cc/troubleshooting/1283.html
 +
 +
参考:https://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q12175812117
 +
 +
==defined(%hash) is deprecated at ./jcode.pl エラー==
 +
エラーメッセージ
 +
defined(%hash) is deprecated at ./jcode.pl line 572.
 +
===対応方法===
 +
572行目
 +
<pre>
 +
- &init_z2h_euc unless defined %z2h_euc;
 +
+ &init_z2h_euc unless defined $z2h_euc_inited;
 +
</pre>
 +
579行目
 +
<pre>
 +
- &init_z2h_sjis unless %z2h_sjis;
 +
+ &init_z2h_sjis unless defined $z2h_sjis_inited;
 +
</pre>
 +
 +
参考:http://tottoco.tsuyushiba.com/Entry/20/
 +
 +
==Can't locate Digest/MD5.pmエラー==
 +
エラーメッセージ
 +
Can't locate Digest/MD5.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .)
 +
perl-Digest-MD5をインストール
 +
$ yum install perl-Digest-MD5
 +
 +
==sjisが文字化けする問題==
 +
$ vi /etc/httpd/conf/httpd.conf
 +
 +
- AddDefaultCharset UTF-8
 +
+ AddDefaultCharset SJIS

2021年12月31日 (金) 17:48時点における最新版

インストール

yum install perl
/usr/bin/perl -v

mod_cgi追加

$ sudo vi /etc/httpd/conf/httpd.conf
LoadModule cgi_module modules/mod_cgi.so

参考:https://www.javadrive.jp/apache/php/index5.html

apacheでcgiを動かす

  • /etc/httpd/conf/httpd.conf
#AddHandler cgi-script .cgi
 ↓
AddHandler cgi-script .cgi

オプションにExecCGIを追加する

<Directory "/var/www/html/cgi-bin">
  Options ExecCGI
</Directory>

apache上でcgiを動かす

$chmod 755 test.cgi

-test.cgi

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello, World.";

AH01215: (2)No such file or directory: exec ofエラー

windowsで作ったものは文末にCR+LF(^M)がつくのでLFのみにしないとerrorとなる ^Mを削除するにはviで開いて"%s/^M//g"とする^Mは[Ctrl+v]を押したまま[Ctrl+m]で入力

参考:https://mgng.mugbum.info/664

linux/vimメモ [ショートカット]

Use of "do" to call subroutines is deprecated at ./jcode.plエラー

エラーメッセージ

AH01215: Use of "do" to call subroutines is deprecated at ./jcode.pl line 328.

以下からjacode.plをDL https://d-wave.cc/troubleshooting/1283.html

参考:https://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q12175812117

defined(%hash) is deprecated at ./jcode.pl エラー

エラーメッセージ

defined(%hash) is deprecated at ./jcode.pl line 572.

対応方法

572行目

- &init_z2h_euc unless defined %z2h_euc;
+ &init_z2h_euc unless defined $z2h_euc_inited;

579行目

- &init_z2h_sjis unless %z2h_sjis;
+ &init_z2h_sjis unless defined $z2h_sjis_inited;

参考:http://tottoco.tsuyushiba.com/Entry/20/

Can't locate Digest/MD5.pmエラー

エラーメッセージ

Can't locate Digest/MD5.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .)

perl-Digest-MD5をインストール

$ yum install perl-Digest-MD5

sjisが文字化けする問題

$ vi /etc/httpd/conf/httpd.conf
- AddDefaultCharset UTF-8
+ AddDefaultCharset SJIS