CGIのページが表示されなくなりました(Internal Server Error)/CGI pages no longer display. (Internal Server Error)
■ 原因
HUC13のシステム更新に伴い,2020年8月31日以降はサーバのOSが更新されています。
セキュリティ上の理由により,PerlやPHPのバージョンに一部変更があります。この影響により,CGIプログラム等でエラーとなる場合があります。
HUC13におけるPerl/PHPのバージョン(2020/9/1時点)
- PHP :7.2.24
- Perl :5.6.23
■ 解決方法
- CGIプログラム(Perl, PHP)の内容を再度ご確認ください
- Perlについては,5.6のバージョンからセキュリティ上の理由で,@INC変数にカレントディレクトリが含まれない仕様になっています。これにより,これまで暗黙的にカレントディレクトリのファイル名で読み込んでいた箇所に対して明示的にパスを指定する必要があります。
- 以下のように,「XXXX.cgi」や「XXXX.pl」でファイル名のみ指定している箇所に,「./」を追記することで動作が確認されたケースもあります。
- require "lib.pl"; → require "./lib.pl";
- $::ini_file = 'pyukiwiki.ini.cgi' if ($::ini_file eq ''); → $::ini_file = './pyukiwiki.ini.cgi' if ($::ini_file eq '');
- また,以下のライブラリ等は,修正を行うことで動作が確認されています
- 日本語ライブラリ(jcode.pl)※ 「defined」を削除する
&init_z2h_euc unless defined %z2h_euc; → &init_z2h_euc unless %z2h_euc;
&init_z2h_sjis unless defined %z2h_sjis; → &init_z2h_sjis unless %z2h_sjis;
- 日本語ライブラリ(jcode.pl)※ 「defined」を削除する
解決できない場合は,以下の情報を メディアセンター問い合わせフォーム よりお知らせください。
- 表示されないホームページのURL(例: https://home.hiroshima-u.ac.jp/imc/ )
- 表示されないホームページの画面キャプチャ
- いつから表示されないか。最終アクセスを確認した時期
- データベースサービスの利用の有無
- CGIプログラムの有無。有の場合は,CGIの内容
------------------------
■Cause
The server operating system has been updated after 31 August 2020 due to the HUC13 system update.
For security reasons, some changes have been made to the Perl and PHP versions. This may cause errors in CGI programmes, etc.
Perl/PHP versions in HUC13 (as of 1 Sep 2020)
・PHP: 7.2.24
・Perl: 5.6.23
■Solution
・Please recheck the contents of your CGI programs (Perl, PHP).
・For Perl, the @INC variable does not include the current directory for security reasons from version 5.6.
As a result, it is necessary to explicitly specify the path to the file name in the current directory, which was implicitly read in the past.
・As shown below, it works by appending '. /' in places where only the file name is specified in 'XXXX.cgi' or 'XXXX.pl', as in the following case.
・require "lib.pl"; → require "./lib.pl";
・$::ini_file = 'pyukiwiki.ini.cgi' if ($::ini_file eq ''); → $::ini_file = './pyukiwiki.ini.cgi' if ($::ini_file eq '');
・In addition, the following libraries and others have been confirmed to work after modification.
・Japanese language library (jcode.pl) * Remove 'defined'.
&init_z2h_euc unless defined %z2h_euc; →
&init_z2h_euc unless %z2h_euc;
&init_z2h_sjis unless defined %z2h_sjis; →
&init_z2h_sjis unless %z2h_sjis;
If you cannot solve the problem, please provide the following information via the Media Centre enquiry form.
・The URL of the homepage that is not displayed (e.g. https://home.hiroshima-u.ac.jp/imc/).
・A screen capture of the homepage that does not appear.
・When was the website not displayed? When the last access was confirmed.
・Whether database services are used or not.
・Presence or absence of CGI programmes. If yes, the contents of the CGI.