LoginSignup
0

More than 5 years have passed since last update.

oil create project でSSL/TLS関連のエラー

Posted at

(ずっと下書きに溜めたまま忘れたたのを思い出した。いまさらニーズがあるかどうかわからないけど公開してみる)

PHPの素人がFuelPHPで新規プロジェクトを作成しようとしたら以下のエラーに遭遇しました。
赤い背景に白い文字で表示されるなんだか恐ろしそうなエラーです。

Unable to locate a valid CA certificate file. You must set a valid 'cafile' option.
A valid CA certificate file is required for SSL/TLS protection.
It is recommended you upgrade to PHP 5.6+ which can detect your system CA file automatically.
You can disable this error, at your own risk, by setting the 'disable-tls' option to true.

[Composer\Repository\InvalidRepositoryException]
No valid composer.json was found in any branch or tag of https://github.com/fuel/parser, could not load a package from it.

環境は以下です。
* Ubuntu 14.04.4
* PHP 5.5.9

PHP5.6以上にすれば自動的に解決するらしいですが現在の環境のままエラーを解消する方法を探したところ、
ComposerからLaravelを導入しようとしてOpenSSL周りのエラーで困った件」と同じ方法で解決できました。

OpenSSL(正確にはcurl)で使用するCAをダウンロード

$ wget http://curl.haxx.se/ca/cacert.pem
$ sudo mv cacert.pem /usr/local/share/ca-certificates/ca-bundle-curl.crt

/etc/php5/cli/php.ini を編集、以下を追加

curl.cainfo=/usr/local/share/ca-certificates/ca-bundle-curl.crt
openssl.cafile=/usr/local/share/ca-certificates/ca-bundle-curl.crt

dora_kou さん、ありがとう!

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0