Centos6にxdebugを入れてみる

phpunitのcoverageを見るために、xdebugを入れてみました
Centos6.5 + Apache で試しました

$ sudo yum install php-pecl-xdebug –enablerepo=epel

設定ファイルを変更して、xdebugを有効にします
$ vim /etc/php.d/xdebug.ini

zend_extension=xdebug.so

コメントアウトを外すだけ

Apache再起動
$ sudo service httpd restart

これで有効になりました

cpコマンドでディレクトリの中身だけコピーする

$ tree
.
├── new
└── one
├── 1.txt
├── 2.txt
└── two

なディレクトリがあって
newの下にoneディレクトリの中身をコピーしたいとき

$ cp -r one new
$ cp -r one/ new
$ cp -r one new/
$ cp -r one/ new/

とかすると

$ tree
.
├── new
│   └── one
│   ├── 1.txt
│   ├── 2.txt
│   └── two
└── one
├── 1.txt
├── 2.txt
└── two

と、oneディレクトリができてしまいます
oneディレクトリいらないのに

$ cp -r one -T new
だとできました

$ tree
.
├── new
│   ├── 1.txt
│   ├── 2.txt
│   └── two
└── one
├── 1.txt
├── 2.txt
└── two

vagrantでubuntuの起動が異常に遅い2

vagrantでubuntuの起動が異常に遅い
に引き続き、違う環境でまた起きたのでメモ

今度は、IP固定せず使っていたのですが、GUIモードで起動すると

cloud-init-nonet waiting 120 seconds for a network device

と同じ現象が発生

$ vagrant ssh
$ vi /etc/network/interfaces

#VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify.
#auto eth1
#iface eth1 inet static
#      address 192.168.33.10
#      netmask 255.255.255.0
#VAGRANT-END

と、IP固定にしてないのでeth1のところをコメントアウトすると直りました
(編集するな、って書いてありますが)

vagrant内のrails serverにアクセスできない

vagrantでubuntuを起動、ruby on railsをインストールして

$ rails s

=> Booting WEBrick
=> Rails 4.2.0 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-02-07 05:49:04] INFO  WEBrick 1.3.1
[2015-02-07 05:49:04] INFO  ruby 2.2.0 (2014-12-25) [x86_64-linux]
[2015-02-07 05:49:04] INFO  WEBrick::HTTPServer#start: pid=2359 port=3000

としてサーバー起動

vagrantで固定IP 192.168.33.10 をふって、port 3000でつながるようにしておいたので
http://192.168.33.10:3000/
で、ブラウザにアクセス..がアクセスできない

rails s のコンソールにも反応が無いです
ping 192.168.33.10は通る

rails 2.2からは localhost しかつながらないらしい

$ rails s -b 0.0.0.0
とするとどのアドレスからもつながるようです

これで解決しました