Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
0
Help us understand the problem. What is going on with this article?

More than 5 years have passed since last update.

@kudarisenmon

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

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

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 さん、ありがとう!

0
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
0
Help us understand the problem. What is going on with this article?