LoginSignup
0
0

More than 5 years have passed since last update.

MacOS Xでcomposerを動かしたときdate_default_timezone_get():と出たときの対処法

Last updated at Posted at 2015-05-22

MacOS Xでcomposerのアップデートをしようとした時、こんなエラーが出て困った。

$composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Removing sebastian/version (1.0.4)

  [RuntimeException]                                                                                                                                                                 
 date_default_timezone_get(): It is not safe to rely on the system's ti  
  mezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting  
   this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.                   

update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [packages1] ... [packagesN]                   

MacOS Xではphp.iniがたくさんあるので、どのphp.iniを使っているのか、調べる必要があります。

$php -i | grep 'Configuration File'
Configuration File (php.ini) Path => /usr/local/etc/php/5.5
Loaded Configuration File => /usr/local/etc/php/5.5/php.ini

こうすると、phpiniがどこにあるか教えてくれる。

$sudo vi /usr/local/etc/php/5.5/php.ini

として、編集してあげればOK。

0
0
0

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
0