あけまして、おめでとうございます。
たけ@キカックです。本年もどうぞよろしくお願い致します。

しばらく日記を書いていなかったのでWordPressのマスコットわぷーにも最後に記事を投稿してから1年……などと言われ続けていました。
放置気味で申し訳ございません。

最近は、と言うか去年からずっとさくらの VPS で CentOS をいじり続けています。
今日はPHP をリモートデバッグできるらしいとのことなので xdebug を入れてみました。

■xdebugのインストール

yum -y install php-pecl-xdebug

■確認
php -i | grep -i “xdebug support”

■エラーが出た
PHP Warning: Unknown: It is not safe to rely on the system’s timezone 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 ‘Asia/Tokyo’ for ‘JST/9.0/no DST’ instead in Unknown on line 0
xdebug support => enabled

■タイムゾーンを設定していないと警告が表示されたので /etc/php.ini を下記のように修正して Apache 再起動
vi /etc/php.ini

;date.timezone =

date.timezone = Asia/Tokyo

■もう一度確認
php -i | grep -i “xdebug support”
xdebug support => enabled

■/etc/php.d/xdebug.ini に下記を追加
※パス・サーバのIPアドレスは適宜

zend_extension=/usr/lib64/php/modules/xdebug.so
xdebug.remote_enable=yes
xdebug.remote_autostart=yes
xdebug.remote_handler=dbgp
xdebug.remote_host=サーバのIPアドレス
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.collect_params=yes
xdebug.dump.GET = *
xdebug.dump.POST = *

 

ただ、今の環境ではHDDの空き容量が乏しく、Eclipseが入りそうにないので後日誰かに試してもらおうと企んでいます。