アプリ版:「スタンプのみでお礼する」機能のリリースについて

携帯・PC共に表示可能な、ページに埋め込み型のカウントダウンができるスクリプトを設置したいと考えています。
そこで発見したのが以下のSSIのスクリプトです。
http://210.143.110.54/soft/cgi/xday.html

しかし、自分はperlに関する知識がないので、いまいち設置の仕方がよくわかりません。(SSI式のカウンターなどは設置に成功しています)
<!--#exec cmd="./xday.pl yyyymmdd"-->で呼び出すとありますが、
サーバがXREAなのでexec cmdが使えません。
何か対応策はありませんでしょうか?

A 回答 (2件)

>print "Content-type: text/html\n\n";


>これはどこの部分に挿入すればいいんでしょうか?
>一応ソースの一番最後の行に挿入してみましたが…。

最初のprintの前までに出力していないといけません。なので

  print "Content-type: text/html\n\n";

  if ($span > 3) {
    print "目的の日まであと ",$span," 日です";
  } elsif ($span > 0) {
    :
    :

といった感じでしょう。

この回答への補足

回答ありがとうございます。
遅くなってしまい、本当に申し訳ありません。

とりあえず今は、
/
└ public_html/
 ├ index.shtml
 └ xday.pl
このような階層で、<!--#exec cgi="./xday.pl"-->と指定しています。
どうやらXREAは引数を指定できないようでした。
すると、
CGIWrap Error: Execution of this script not permitted
Execution of (xday.pl) is not permitted for the following reason:
Script is not executable. Issue 'chmod 755 filename'
となってしまいました。どうやらパーミッション604では駄目みたいで。

そこで705にしてみたところ
Script Error
The script did not produce proper HTTP headers. Please see the error log to see the detail of the errors. Depending on the server configuration, you can also run thisscript under CGIWrap debugging. Usually, either rename or linkthe script temporarily to a file which ends with .cgidextension, or add a AddHandler cgi-script-debug .cgiline to your .htaccess file.

となってしまいました汗
print "Content-type: text/html\n\n";はもちろん入れているんですが…。
<!--#include virtual="./xday.pl"-->なども試しましたが同じ結果でした。
拡張子のせいなのかな…などと思っていますが一体原因はなんなのでしょうか?今一度お助けください。。

補足日時:2008/03/02 07:20
    • good
    • 0

#XREAのサポードボードでFAQの気がしますが・・



「exec cmd」はダメですが「exec cgi」は使えます。CGIを改造してhttpヘッダを返すようにすればexec cgiで動かせると思いますよ。

(蛇足)
httpヘッダってこんなの↓です。提示されたCGIには(exec cmdが前提なので)入ってないと思います。

  print "Content-type: text/html\n\n";

この回答への補足

print "Content-type: text/html\n\n";
これはどこの部分に挿入すればいいんでしょうか?
一応ソースの一番最後の行に挿入してみましたが…。

--------
xday.pl を適当なディレクトリに配置し実行属性をセットします
※ 使用目的に応じて内容も若干書き換えます

準備ができたら以下の書式で呼び出します

<!--#exec cmd="./xday.pl yyyymmdd"-->
コマンドへのパスは環境に応じて適宜変更してください
引数として目的の日を yyyymmdd で指定します
--------

配布先にはこのように書いてあるんですが、
パーミッションは604、
/
└ public_html/
├ index.shtml
└ xday/
└ xday.pl
階層はこのような感じなのですが、
<!--#exec cgi="./xday.pl 20080401"-->
とやってみましたが、やはり[an error occurred while processing this directive] となってしまいました。
なぜでしょうか。。

補足日時:2008/02/29 12:19
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!