2009年12月13日日曜日

xdebugインストール

xdebugはpeclでインストールする。

peclは別個で入れるかどうかするのですが、SuSEユーザの私は「php-devel」をインストールしたときに自動的に入ります。

それで早速コマンド
# pecl install xdebug
downloading xdebug-2.0.5.tar ...
Starting to download xdebug-2.0.5.tar (Unknown size)
...............................................................................................................................................................................................................................................................done: 1,340,928 bytes
67 source files, building
WARNING: php_bin /usr/bin/php5 appears to have a suffix 5, but config variable php_suffix does not match
running: phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_static_works, ...): suspicious cache-id, must contain _cv_ to be cached
../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:1994: AC_CACHE_CHECK is expanded from...
aclocal.m4:3555: AC_LIBTOOL_LINKER_OPTION is expanded from...
aclocal.m4:5493: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:5492: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:2972: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:2952: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:2915: AC_PROG_LIBTOOL is expanded from...
configure.in:150: the top level
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:3510: AC_LIBTOOL_COMPILER_OPTION is expanded from...
aclocal.m4:7620: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_CXX, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:5606: _LT_AC_LANG_CXX_CONFIG is expanded from...
aclocal.m4:5605: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
aclocal.m4:4641: _LT_AC_TAGCONFIG is expanded from...
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_static_works, ...): suspicious cache-id, must contain _cv_ to be cached
../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:1994: AC_CACHE_CHECK is expanded from...
aclocal.m4:3555: AC_LIBTOOL_LINKER_OPTION is expanded from...
aclocal.m4:5493: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:5492: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:2972: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:2952: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:2915: AC_PROG_LIBTOOL is expanded from...
configure.in:150: the top level
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:3510: AC_LIBTOOL_COMPILER_OPTION is expanded from...
aclocal.m4:7620: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_CXX, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:5606: _LT_AC_LANG_CXX_CONFIG is expanded from...
aclocal.m4:5605: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
aclocal.m4:4641: _LT_AC_TAGCONFIG is expanded from...
building in /var/tmp/pear-build-root/xdebug-2.0.5
running: /tmp/pear/temp/xdebug/configure
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... no
checking for gcc... no
configure: error: in `/var/tmp/pear-build-root/xdebug-2.0.5':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
ERROR: `/tmp/pear/temp/xdebug/configure' failed

cc、gccがないからコンパイルできないぞ・・・と


yastでcc、gccをインストールして再実行。
# pecl install xdebug
downloading xdebug-2.0.5.tar ...
Starting to download xdebug-2.0.5.tar (Unknown size)
...............done: 1,340,928 bytes
67 source files, building
WARNING: php_bin /usr/bin/php5 appears to have a suffix 5, but config variable php_suffix does not match
running: phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_static_works, ...): suspicious cache-id, must contain _cv_ to be cached
../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:1994: AC_CACHE_CHECK is expanded from...
aclocal.m4:3555: AC_LIBTOOL_LINKER_OPTION is expanded from...
aclocal.m4:5493: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:5492: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:2972: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:2952: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:2915: AC_PROG_LIBTOOL is expanded from...
configure.in:150: the top level
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:3510: AC_LIBTOOL_COMPILER_OPTION is expanded from...
aclocal.m4:7620: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_CXX, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:5606: _LT_AC_LANG_CXX_CONFIG is expanded from...
aclocal.m4:5605: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
aclocal.m4:4641: _LT_AC_TAGCONFIG is expanded from...
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_static_works, ...): suspicious cache-id, must contain _cv_ to be cached
../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:1994: AC_CACHE_CHECK is expanded from...
aclocal.m4:3555: AC_LIBTOOL_LINKER_OPTION is expanded from...
aclocal.m4:5493: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:5492: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:2972: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:2952: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:2915: AC_PROG_LIBTOOL is expanded from...
configure.in:150: the top level
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:3510: AC_LIBTOOL_COMPILER_OPTION is expanded from...
aclocal.m4:7620: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_CXX, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:5606: _LT_AC_LANG_CXX_CONFIG is expanded from...
aclocal.m4:5605: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
aclocal.m4:4641: _LT_AC_TAGCONFIG is expanded from...
building in /var/tmp/pear-build-root/xdebug-2.0.5
running: /tmp/pear/temp/xdebug/configure
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib
checking for PHP extension directory... /usr/lib64/php5/extensions
checking for PHP installed headers prefix... /usr/include/php5
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.13.5 (ok)
checking for gawk... gawk
checking whether to enable eXtended debugging support... yes, shared
checking for gettimeofday... yes
checking for cos in -lm... yes
checking for ld used by cc... /usr/x86_64-suse-linux/bin/ld
checking if the linker (/usr/x86_64-suse-linux/bin/ld) is GNU ld... yes
checking for /usr/x86_64-suse-linux/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc static flag works... yes
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/x86_64-suse-linux/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
running: make
sh: make: command not found
ERROR: `make' failed


あれ、makeもはいってなかった・・・


makeもインストールして、再実行!
Build process completed successfully
Installing '/usr/lib64/php5/extensions/xdebug.so'
install ok: channel://pecl.php.net/xdebug-2.0.5
configuration option "php_ini" is not set to php.ini location
You should add "extension=xdebug.so" to php.ini


最後だけ抜粋ですがokのようです。
# service apache2 restart
Syntax OK
Shutting down httpd2 (waiting for all children to terminate) done
Starting httpd2 (prefork) done



phpinfoで確認してok

pear.php.net is using a unsupported protocal - This should never happen.

最近Macサーバに移行してから、プログラム類や開発関係のデータもちょっとずつ
移行させているのですが、「あ、xdebug入れてない」と思って、導入開始しました。

たしか、peclかなんかのコマンドで行けるんじゃなかったっけ?
と思って、pearコマンドでインストール開始。

でも、xdebugとは別に以下のエラーが出てしまいました。

pear.php.net is using a unsupported protocal - This should never happen.

これはインストール以前の問題ですね。

プロトコルアンサポート・・・

とりあえずチャンネルを更新しようとおもって、以下のコマンド実行
# pear update-channels
Updating channel "doc.php.net"
Channel "doc.php.net" is up to date
Updating channel "pear.php.net"
Channel "pear.php.net" is up to date
Updating channel "pecl.php.net"
Channel "pecl.php.net" is up to date


あれ、こんなんだっけ?

再度、xdebugインストール実行
# pear install xdebug
pear.php.net is using a unsupported protocal - This should never happen.
install failed



だめだ・・・



それでエラーコードを検索していたら、pearのblogで原因判明!
http://blog.pear.php.net/2009/08/28/fixing-unsupported-protocol/
5.2.10と5.2.11が対象って書いてあるけど、5.3.0も対象ね。


以下、pearのblogより抜粋で実行
# cd `pear config-get php_dir`
# mv .channels .channels-broken
# pear update-channels

どうにもチャンネルデータが壊れているので、消して(もしくは移動して)再取得すればいいみたい。

3行目の「pear update-channels」でチャンネルデータ再取得でok

うちは、タイムゾーンの設定不備で以下のエラーも出ちゃったけど、チャンネル更新はok
Warning: date(): 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 PEAR/Registry.php on line 930
PHP Warning: date(): 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 /usr/share/php5/PEAR/PEAR/Registry.php on line 930

Warning: date(): 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 PEAR/Registry.php on line 930
PHP Warning: date(): 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 /usr/share/php5/PEAR/PEAR/Registry.php on line 930

Warning: date(): 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 PEAR/Registry.php on line 930
PHP Warning: date(): 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 /usr/share/php5/PEAR/PEAR/Registry.php on line 930
Updating channel "pear.php.net"
Update of Channel "pear.php.net" succeeded
Updating channel "pecl.php.net"
Update of Channel "pecl.php.net" succeeded

succeededってでてるのでok


今度こそxdebugインストール!
# pear install xdebug
No releases available for package "pear.php.net/xdebug" - package pecl/xdebug can be installed with "pecl install xdebug"
install failed

peclでやれと・・・

2009年12月11日金曜日

svn: Can't open fileエラー

svnサーバにコミットしたところ以下のようなエラーが返ってきてしまった。

svn: Can't open file '/var/svn/hogehoge/db/txn-current-lock': Permission denied
svn: MKACTIVITY of '/repos/hogehoge/!svn/act/069d9079-2501-0010-a783-df4e102faed0': 500 Internal Server Error (http://hogehoge.com)


というようなエラーが出てしまった・・・

Permission deniedということから、パーミッション設定がよくないらしい・・・


確認してみると、オーナーがrootになってました。

apache2のmod_davでsvnを利用している以上、apache2が操作できる権限にしておかなきゃね。

2009年12月7日月曜日

scpでファイル転送

svnのサーバを移動しないといけないので、scpコマンドの覚書です。

# scp [転送元アドレス] [転送先アドレス]

# 今回はファイルをリモートホストに転送します。
# scp svn_dump_test root@192.168.1.x:/var/svn/
The authenticity of host '192.168.1.xx (192.168.1.xx)' can't be established.
RSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx.
Are you sure you want to continue connecting (yes/no)? yes # 初めての接続なので・・・
Warning: Permanently added '192.168.1.xx' (RSA) to the list of known hosts.
Password: *********

subversion設定の覚書

いつも忘れちゃうので、覚書です。

# ディレクトリ作成
# mkdir /var/svn
# mkdir /var/svn/test


# ファイルシステムで作成
# svnadmin --fs-type fsfs create /var/svn/test


今回はサーバ移動なので、以下の作業もします

# サーバAでダンプ
# svnadmin dump /var/svn/test > svn_dump_test


# サーバBでリストア
# mkdir /var/svn
# mkdir /var/svn/test
# svnadmin --fs-type fsfs create /var/svn/test
# svnadmin load /var/svn/test < svn_dump_test

2009年12月6日日曜日

MACでDDNS設定をする

年末の里帰りに向けて、MACにDDNSの設定をしようと思う。

今まではIODATAのiobb.netサービスを利用してDDNSを実現していたのですが、
先日のブログ記事の通り、「MAC mini on X Server」と「AirMac Base Station」を購入したので、できればそっちを利用したい。

設定ができなければ、IODATAのサービスを利用するという逃げ道もありです。


まずDDNSサービスですが、これはVALU-DOMAINが使えるみたいです。

この形式でリクエストすればいいみたいです。
http://dyn.value-domain.com/cgi-bin/dyn.fcg?d=ドメイン名&p=パスワード&h=ホスト名&i=IPアドレス

あと、IPアドレスの指定は設定しなければ、自動認識のようなので簡単です。


さっそくwgetでリクエストしたのですが、エラーが出てしまいます。
どうやら、macはwgetが無い模様・・・だけど、curlというのが有るみたいなので、これで試してみます。

# curl http://dyn.value-domain.com/cgi-bin/dyn.fcg?d=ドメイン名&p=パスワード&h=ホスト名
# status=2


statusの2は不正な「ドメイン名とパスワード」のときのメッセージです。
おかしいと思って、ブラウザのURL欄で試してみるも、こちらはOK!
「status=0」が返ってきます。


ちょっとした気まぐれで、URLをシングルクォーテーションで囲んでみたら、これが大当たり!
# curl 'http://dyn.value-domain.com/cgi-bin/dyn.fcg?d=ドメイン名&p=パスワード&h=ホスト名'
status=0


これで、ドメイン更新はOKだね!