dounokouno / TransmitMail

Copyright表示不要のPHP製汎用メールフォームシステム
http://etc.dounokouno.com/TransmitMail/
MIT License
142 stars 48 forks source link

TransmitMailが動きません。500エラーが出てしまいます #97

Open Masaki-G opened 1 month ago

Masaki-G commented 1 month ago

aws ec2にホストしています

[ec2-user@ip-172-31-38-97 config]$ php -v
PHP 7.4.33 (cli) (built: Nov 19 2022 00:22:13) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
[ec2-user@ip-172-31-38-97 config]$

/regist/bank/にアクセスすると500エラーが出ます

ログには下記のように出ています

[ec2-user@ip-172-31-38-97 log]$ tail -f error.log
[13-Jun-2019 11:37:58 Asia/Tokyo] PHP Warning:  mb_convert_kana() expects parameter 1 to be string, array given in /xxxx/TransmitMail.php on line 572
[13-Jun-2019 11:44:43 Asia/Tokyo] PHP Warning:  mb_convert_kana() expects parameter 1 to be string, array given in /xxxx/TransmitMail.php on line 572
[13-Jun-2019 11:44:47 Asia/Tokyo] PHP Warning:  mb_convert_kana() expects parameter 1 to be string, array given in /xxxx/TransmitMail.php on line 572
[13-Jun-2019 11:44:53 Asia/Tokyo] PHP Warning:  mb_convert_kana() expects parameter 1 to be string, array given in /xxxx/TransmitMail.php on line 572
[13-Jun-2019 11:45:04 Asia/Tokyo] PHP Warning:  mb_convert_kana() expects parameter 1 to be string, array given in /xxxx/TransmitMail.php on line 572
[13-Jun-2019 11:45:59 Asia/Tokyo] PHP Warning:  mb_convert_kana() expects parameter 1 to be string, array given in /xxxx/TransmitMail.php on line 572
[13-Jun-2019 12:46:54 Asia/Tokyo] PHP Warning:  filesize(): stat failed for https://example.net/thanks_bank/ in xxxx/tinyTemplate.php on line 79
[13-Jun-2019 12:46:54 Asia/Tokyo] PHP Warning:  fread(): Length parameter must be greater than 0 in xxxx/tinyTemplate.php on line 79
[13-Jun-2019 12:57:51 Asia/Tokyo] PHP Warning:  filesize(): stat failed for https://example.net/thanks_bank/ in xxxx/tinyTemplate.php on line 79
[13-Jun-2019 12:57:51 Asia/Tokyo] PHP Warning:  fread(): Length parameter must be greater than 0 in xxxx/tinyTemplate.php on line 79
dounokouno commented 1 month ago

@Masaki-G 様

まず上記コメントのエラーメッセージのドメイン部分は example.com example.net に置換させていただきました(このようなオープンな場所では、ドメインは example.com のような文字列に書き換えていただくのが良いかと思います)。

そして次に、エラーメッセージの Warning の行はあくまで警告であり、プログラムが中断するようなエラーではありませんので、エラーログの内容は特に問題ないように思います。

一点確認いただきたいこととしましては、「チェックモード」を有効にし、「チェックモード」のページを閲覧した場合にはどのように表示されますでしょうか?もし「 NG 」が表示されていた場合は「 NG 」の箇所を修正してみてください。

https://github.com/dounokouno/TransmitMail/wiki/設定ファイルの記述方法(v2)#チェックモードの利用

また今回のサーバーでは PHP は php-fpm などで動作させていますでしょうか? php-fpm を利用されている場合は、おそらく /var/log/php-fpm あたりにログが出力されているかと思いますので、そちらも参照いただければ幸いです(どのように php-fpm をインストールしたかでログの場所は変わるかと思います)。

Masaki-G commented 1 month ago

ご返信ありがとうございます。 そのまま載せてしまい申し訳ありません。 configは下記のようになっております

$ cat config.yml
config:
    email: """"
    subject: """"
    auto_reply_subject: """"
    auto_reply_name: """"
    log_dir: '/home/example.net/public_html/regist/bank/log/'  # ログファイルのディレクトリを指定
    display_error: false  # エラーを画面ではなくログに出力
    checkmode: 2

ですが今アクセスすると

Service Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

このようになります

Masaki-G commented 1 month ago

php-fpmではいれてないです

仮になのですがindex.phpにphpinfo()を記述してみるとちゃんと画面にphpの情報が表示されているのでphp実行自体は問題ないかと考えております

dounokouno commented 1 month ago

上記件、了解いたしました。

今アクセスすると

上記はどのページにアクセスした際のエラーメッセージでしょうか?エラーメッセージが表示された際のエラーログもご確認いただけるとありがたいです。

Masaki-G commented 1 month ago

https://example.com/regist/bank/

[ec2-user@ip-172-31-38-97 bank]$ ls
config  confirm.html  css  error.html  finish.html  img  index.html  index.php  lib  log  tmp
[ec2-user@ip-172-31-38-97 bank]$ pwd
/home/xxxx.com/public_html/regist/bank
[ec2-user@ip-172-31-38-97 bank]$

index.php

[ bank]$ cat index.php
<?php
/**
 * TransmitMail
 *
 * @package   TransmitMail
 * @license   MIT License
 * @copyright TAGAWA Takao, dounokouno@gmail.com
 * @link      https://github.com/dounokouno/TransmitMail
 */

require_once 'lib/TransmitMail.php';

try {
    $tm = new TransmitMail('config/config.yml');
    $tm->run();
} catch (Exception $e) {
    error_log($e->getMessage());
    echo 'Caught exception: ',  $e->getMessage(), "\n";
}
[ bank]$

エラーログこちらでよろしいでしょうか

[Thu Aug 22 23:54:00.376981 2024] [proxy_fcgi:error] [pid 7919:tid 7919] [client 80.65.211.20:59606] AH01079: failed to make connection to backend: localhost
[Thu Aug 22 23:54:01.803397 2024] [proxy:error] [pid 7812:tid 7812] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php-fpm/www.sock (localhost:8000) failed
[Thu Aug 22 23:54:01.803431 2024] [proxy_fcgi:error] [pid 7812:tid 7812] [client 80.65.211.20:59616] AH01079: failed to make connection to backend: localhost
[Thu Aug 22 23:54:02.632842 2024] [proxy:error] [pid 7498:tid 7498] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php-fpm/www.sock (localhost:8000) failed
[Thu Aug 22 23:54:02.632876 2024] [proxy_fcgi:error] [pid 7498:tid 7498] [client 80.65.211.20:57342] AH01079: failed to make connection to backend: localhost
[Thu Aug 22 23:54:03.685209 2024] [proxy:error] [pid 7994:tid 7994] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php-fpm/www.sock (localhost:8000) failed
[Thu Aug 22 23:54:03.685242 2024] [proxy_fcgi:error] [pid 7994:tid 7994] [client 80.65.211.20:57344] AH01079: failed to make connection to backend: localhost
[Thu Aug 22 23:54:05.477687 2024] [proxy:error] [pid 8165:tid 8165] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php-fpm/www.sock (localhost:8000) failed
[Thu Aug 22 23:54:05.477722 2024] [proxy_fcgi:error] [pid 8165:tid 8165] [client 80.65.211.20:57346] AH01079: failed to make connection to backend: localhost
Masaki-G commented 1 month ago

sudo yum install php-fpm でいれて sudo systemctl start php-fpmしたのですが

500エラーになってしまいました

Masaki-G commented 1 month ago

至急動かさないといけず、報酬のようなものをお支払いしますので一緒に見ていただけないでしょうか。 申し訳ありません

dounokouno commented 1 month ago

お返事遅くなりました🙇どこまでお役に立てるかわかりませんが、下記のメールアドレス宛にご連絡ください。

dounokouno[@]gmail.com