Closed NekoFuwa1739 closed 3 years ago
ご不便とご迷惑をお掛けしまして、誠に申し訳ございません。 また、反応遅れました事をお詫び申し上げます。
discord起動時のオプションにて、コンソールへのdiscordPHP
に関するログ出力を有効化をしている為にてございます。
コンソールへのログ出力をオプション化致します。 (discord接続トラブル時に備え、デフォルトにて有効とします... 申し訳ございません...)
2021年1月24日終日まで実装します。
ご不便とご迷惑をお掛けしました事をお詫び申し上げます。
(類似したエラー再現コードにてございます。)
file_get_contents("https://www.example.com");
Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed in Command line code on line 1
Warning: file_get_contents(): Failed to enable crypto in Command line code on line 1
Warning: file_get_contents(https://www.example.com): failed to open stream: operation failed in Command line code on line 1
重要なエラー文
operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed in Command line code on line 1
サーバーにSSL証明書
(ssl root証明書)存在しない事は原因です。
phpバイナリに付属せず(場合に依ります。)、コンビューター付属のssl証明書
を利用する為です(Android付属のssl証明書に関しましては、Linuxと異なり、特殊なアクセス方法を用いる為)
SSL証明書
をダウンロードします。↓「cacert.pem」ダウンロードリンクにてございます... https://curl.haxx.se/ca/cacert.pem
以下のリポジトリよりダウンロード致しました、phpバイナリにてPocketMine-MPを動作致しましております、前提にて説明を実施します。
○ AndroidPHP`
× vps
△ pj***** (読み飛ばしをお願いします...(本当に申し訳ないです))
https://github.com/DaisukeDaisuke/AndroidPHP
/sdcard/Download/cacert.pem
↓
/sdcard/PocketMine/config/cacert.pem
/[本体ストレージ]/Download/cacert.pem
↓
/[本体ストレージ]/PocketMine/config/cacert.pem
/sdcard/PocketMine/config/php.ini
/[本体ストレージ]/PocketMine/config/php.ini
openssl.cafile='/sdcard/www/config/cacert.pem'
curl.cainfo='/sdcard/www/config/cacert.pem'
php
pj*****を所有していない為、不明にてございますものの、php.iniファイルに関しましては、以下のディレクトリに存在致しますと私は思います...
/bin/php7/bin/php.ini
openssl.cafile='/[アップロード先のディレクトリ]/cacert.pem'
curl.cainfo='/[アップロード先のディレクトリ]/cacert.pem'
サーバー起動、エラー内容の変換/正常に接続した事を確認します。
丁寧なお返事ありがとうございます!自分はvpsなので実装 されるまでお待ちしてますm(* )m carert.pemはvpsには必要なかったんですね(--;)
分かりにくく、申し訳ないです。 carert.pemに関しましては、「vpsにも必要」にてございます。
了解です。 忙しく、重要な説明を省略していました為、追記します...
SSL証明書
をダウンロードします。↓ダウンロードリンク... https://curl.haxx.se/ca/cacert.pem
「php.ini」ファイルに関しましては、恐らく「bin」フォルダ内に存在致しますと私は思います...
openssl.cafile='/[アップロード先のディレクトリ]/cacert.pem'
curl.cainfo='/[アップロード先のディレクトリ]/cacert.pem'
php /[PocketMine-MP]/PocketMine-MP.phar
php -c /[PocketMine-MP]/config/php.ini /[PocketMine-MP]/PocketMine-MP.phar
php -c (php.iniファイルの場所) /[PocketMine-MP]/PocketMine-MP.phar
discordPHPの更新、デフォルトログレベルを「warning」に変更しました... 時間を要しました事をお詫び申し上げます。
↓ダウンロードリンクにてございます... https://github.com/DaisukeDaisuke/pmmpDiscordBot/releases/tag/3.0.3
ありがとうございますm(* )m logは出力されなくなったのですが、まだBotの方が起動されませんでした… 何故か自分のサーバーはbinフォルダがなくても起動できています… 終了時に画像のようなものが出ます…
非常に申し訳ないですのですが、サーバー起動時にエラー発生している場合、エラーのスクリーンショットをこのissuesへ投稿していただけませんでしょうか....? 再読み込み対応していない可能性も存在致します... 申し訳ないです...
すみません!もしかしてDiscordPHPってゆうやつですかね…?
このissueの先頭にて報告していただきました、エラーと同じと推測されます...
cacert.pem
に関しましては、正しく設定しておりますでしょうか...?
また、phpの場所は分かります場合、以下のコマンドの事項結果にて表示致しました場所にphp.ini
存在致します...
bin\[.....]\php --ini
I:\Owner\Desktop\php_vscode\bin\php\php --ini
Loaded Configuration File: I:\Owner\Desktop\php_vscode\bin\php\php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)
cacert.pem
のに関する設定を追記します。I:\Owner\Desktop\php_vscode\bin\php\php.ini
非常に申し訳ないですのですが、[アップロード先のディレクトリ]
に関しましては、柔軟に変更をお願いします。
openssl.cafile='/[アップロード先のディレクトリ]/cacert.pem'
curl.cainfo='/[アップロード先のディレクトリ]/cacert.pem'
wget https://curl.haxx.se/ca/cacert.pem
以下のコマンドの出力をメモします
今回に関しましては、例として/???/
を出力したとして説明を行います...
pwd
コマンド実行結果(例にてございます。)
/???/
つまり...?
/???/cacert.pem へssl証明書ファイルをダウンロードし、
ダウンロード先のディレクトリをpwd
コマンドにて取得しました
php --ini
Loaded Configuration File: /???/???/php.ini (例にてございます。)
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)
nano /???/???/php.ini
非常に申し訳ないですのですが、/???/
に関しましては、柔軟に変更をお願いします。
openssl.cafile='/???/cacert.pem' # 例にてございます。
curl.cainfo='/???/cacert.pem'# 例にてございます。
度々すみません… おかげでphp.iniが見つかったんですけど通常のやつと違って、ほとんどの行初めに" ; "が付いてるんですけど openssl.cafile='/pmmp/cacert.pem' curl.cainfo='/pmmp/cacert.pem' の時も同じように" ; "をつけた方がいいのですかね?
「;」や「#」に関しましてはコマンドの為、今回新規に追加する設定では、不要にてございます。
;コメントです
;ssl証明書を指定します。
openssl.cafile='/pmmp/cacert.pem';opensslにて使用する証明書ファイルを指定します
curl.cainfo='/pmmp/cacert.pem';curlにて使用する証明書ファイルを指定します
了解です! 保存しようとしたら権限がありませんと言われてしまいました…
非常に申し訳ないですのですが、一度 「Ctrl」→ 「x」(バツではない)→「改行(エンター)」→「n」...?の操作を実施し、nano editorをファイルを保存せずに終了(権限のない状態でのnanoエディタ内でのファイル保存は複雑な為、一度保存せずに終了します。)、
(rootパスワード入力) = vpsサーバーのサーバー内rootパスワード/vpsサーバーsshログイン時(...?)に使用するパスワードの入力をお願いします。
sudoコマンドをご存じの場合以下のコマンドを実行をお願いします。
sudo nano /etc/php/7.4/cli/php.ini
(パスワード入力)
ご存じではない場合、以下のコマンドを実行して頂きたいです...
su
(rootパスワード入力)
nano /etc/php/7.4/cli/php.ini
exit
cacert.pemも置きおかげで保存もできたのですが、変わらずDiscordPHPのエラーが出てしまいます… もうだめなんですかね…
エラー文に関しましては、以下のコメントのエラー文と同じにてございますでしょうか...? https://github.com/DaisukeDaisuke/pmmpDiscordBot/issues/1#issuecomment-766299644
同じ場合、以下のコマンドの実行結果を教えていただけませんでしょうか...?
php -i | grep cainfo
はい、同じエラー文です。 下記が実行結果です
遅れて申し訳ないです...
特定関数不足している事に関しましては、原因の可能性に関しましては、存在致します... pmmp公式サイトより、pmmp向けphpバイナリをダウンロード、解凍、設定します。
# cd [start.sh存在致します、フォルダ]
cd /home/ubuntu/pmmp/
wget https://jenkins.pmmp.io/job/PHP-7.4-Aggregate/lastSuccessfulBuild/artifact/PHP-7.4-Linux-x86_64.tar.gz
(wget https://bit.ly/2MkioFO)
tar -zxvf PHP-7.4-Linux-x86_64.tar.gz
nano /home/ubuntu/pmmp/bin/php7/bin/php.ini
openssl.cafile='/home/ubuntu/pmmp/cacert.pem'
curl.cainfo='/home/ubuntu/pmmp/cacert.pem'
「Ctrl」→ 「o」(マルではない)→「改行(エンター)」
「Ctrl」→ 「x」(バツではない)→「改行(エンター)」
./start.sh
(sh ./start.sh)
./start.shが実行できませんでした…
php.ini
ファイル「1行目」付近の=
付近の構文は誤りは存在致します、模様にてございます。
原因不明な場合、以下のコマンドを実行、スクリーンショットをこのissueへ投稿してただけませんでしょうか...? (いずれかのコマンド結果のスクリーンショットをお願いします...(本当に申し訳ないです...))
cat /home/ubuntu/pmmp/bin/php7/bin/php.ini
cd /home/ubuntu/pmmp/
cat ./bin/php7/bin/php.ini
nano /home/ubuntu/pmmp/bin/php7/bin/php.ini
これです…すみません…
php,ini
に関しましては、改行必須にてございます...
本当に申し訳ないです...
memory_limit=1024M dete.timezone=UTC short_open_tag=0
memory_limit=1024M
dete.timezone=UTC
short_open_tag=0
ありがとうございますm(* )m 起動出来ました…残念ながらエラー文は変わらず出てます…
以下のコマンド実行致しました結果のスクリーンショットを教えていただけませんでしょうか...?
/home/ubuntu/pmmp/bin/php7/bin/php -c /home/ubuntu/pmmp/bin/php7/bin/php.ini -r "var_dump(file_get_contents('https://www.example.com'));"
cacert.pem認識していない場合...
Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed in Command line code on line 1
Warning: file_get_contents(): Failed to enable crypto in Command line code on line 1
Warning: file_get_contents(https://www.example.com): failed to open stream: operation failed in Command line code on line 1
bool(false)
/etc/resolv.conf 不正...(正常な状態にて、「resolv.conf」ファイルを操作致しました場合、「インターネット接続出来なくなる」為、注意)
Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed. errno=2 in Command line code on line 1
Warning: file_get_contents(https://www.example.com): failed to open stream: php_network_getaddresses: gethostbyname failed. errno=2 in Command line code on line 1
bool(false)
This domain is for use in illustrative examples in documents. You may use this domain in literature without prior coordination or asking for permission.
遅れてすみません…スクリーンショットでございます… 役に立つかわかりませんが、りーさんが紹介されていた 物を使っています… https://qiita.com/ree-jp/items/4f3e906a09d7576fb786
Websocket接続に関しましては、少しややこしいとの事です.... websocket+docker https://www.google.com/search?q=websocket+docker
DockerでnginxでwebSocket https://qiita.com/tomipetit/items/718e12443fd3715519cf
//=========== Docker compose ことはじめハンズオン https://qiita.com/TsutomuNakamura/items/7e90e5efb36601c5bc8a
Docker compose インストール => 設定ファイル構築(記述) => 実行 流れの模様にてございます。
検証中...
証明書を使ったリポジトリクライアントの確認 https://matsuand.github.io/docs.docker.jp.onthefly/engine/security/certificates/
Docker デーモンソケットの保護 https://matsuand.github.io/docs.docker.jp.onthefly/engine/security/https/
(...?)
/etc/docker/certs.d/***.crt
https://www.ogis-ri.co.jp/otc/hiroba/technical/docker/part6.html 参考サイト曰、以下のオプションにて、証明書ファイルを指定致しますと、良いとの事です...
--tlsverify
--tlscacert="C:\\Users\\Taro\\.docker\\machine\\machines\\myhost\\ca.pem"
--tlscert="C:\\Users\\Taro\\.docker\\machine\\machines\\myhost\\cert.pem"
--tlskey="C:\\Users\\Taro\\.docker\\machine\\machines\\myhost\\key.pem"
-H=tcp://192.168.99.100:2376 ## tcp/udp使用ボート不明...
自分では理解が追いつかないですね()…
本当にご丁寧にありがとうございます…感謝します!
Discordの反応もなくこんな感じで大量のログが何個も出てきます…何が原因分かりますかね…