[PHP-users 23039]cronからの動作として

AMO 伊東 丈仁 itoh @ amoffice.co.jp
2004年 8月 23日 (月) 16:10:34 JST


テストで「test.php」が読み込まれたら、DBに登録みたいのを作っています。

■環境
PHPは4.2.2
DBはpostgres
を使用しています。

■crontab内の設定
*/1 * * * * root /home/sites/www.domain.jp/web/test/test.php
※テストで1分置きに実行

■実行結果をメール送信
/home/sites/www.domain.jp/web/test/test.php: ?php: No such file or directory
/home/sites/www.domain.jp/web/test/test.php: include: command not found
/home/sites/www.domain.jp/web/test/test.php: include: command not found
/home/sites/www.domain.jp/web/test/test.php: include: command not found
/home/sites/www.domain.jp/web/test/test.php: =: command not found
/home/sites/www.domain.jp/web/test/test.php: line 7: syntax error near
unexpected token `$db->Connect()'
/home/sites/www.domain.jp/web/test/test.php: line 7: `$db->Connect();'

「No such file or directory」もしくは「command not found」が原因と考えられま
すが、
7行目にエラーと出ています。

includeファイルが読み込めていないのが原因だと思うのですが、
普通にWEBで「test.php」は動作します。

■test.php ソース内
1行目:<?php
2行目:include './class/dbConnect.class'; ← 使用するクラスファイルを指定
3行目:include './func/datetime.fnc'; ← 使用する関数ファイルを指定
4行目:include './func/system.fnc'; ← 使用する関数ファイルを指定
5行目:
6行目:$db = new dbConnect; ← // データベース接続
7行目:$db->Connect(); ← // データベース接続

正しい設定方法がありましたら、教えて下さい。

伊東



PHP-users メーリングリストの案内