Zend Debugger をインストール
この記事は自分がLAMP開発環境を構築する目的で、 VirtualBox 仮想マシンの Ubuntu(32bit) に Zend Debugger をインストールした手順です。
前提
VirtualBoxでUbuntu Desktop 12.04 LTS(32bit)が実行できる仮想マシンが出来ているものとします。
その仮想マシンにapache2 と PHP がインストールされているものとします。
(参考サイト)
Installing Zend Debugger on Linux
http://forums.zend.com/viewtopic.php?f=59&t=962#p4190
zend debugger ダウンロード
まずはこちらのサイトから
http://www.zend.com/community/pdt/downloads
Studio Web Debugger 20110410 (32 bit)
をダウンロードします。
ダウロードするにはユーザ登録が必要です。
Firefox が ダウンロード後、Archive Manager でファイルを開くか聞いてくるので、「OK」をクリックし、ダウンロードを開始します。
Zend Debugger を解凍する
ダウンロードが終わると Archive Manager が起動します。
こらからダウンロードしたファイルを解凍します。
「Extract」ボタンを押して解凍します。
解凍先を指定するダイアログが開きます。
規定でログインユーザのホームディレクトリが表示されると思います。
そのまま「Extract」ボタンをクリックし、そこに解凍ます。
Zend Debugger を配置する
Terminalを開きます。
以降は Terminal でコマンドを入力していきます。
opt ディレクトリ下にダウンロードした Zend Debugger を配置しましょう。
ついでに動作確認用のファイル、dummy.php を /var/www/ ディレクトリ下に配置します。
sudo cp -r ~/ZendDebugger-20110410-linux-glibc23-i386/ /opt sudo cp ~/ZendDebugger-20110410-linux-glibc23-i386/dummy.php /var/www/
Zend Debugger を設定する
配置できたらそこから Zend Debugger が PHP に読み込まれるように設定します。
設定ファイルを作ります。
sudo gedit /etc/php5/conf.d/zend.ini
「[sudo] password for user1: 」と聞かれたらログインパスワードを入力して下さい。
次のように gedit というテキストエディタが開きます。
次の内容をエディタに貼付けて保存し、終了して下さい。
注意として「zend_extension =」のところは先に Zend Debugger を配置した場所に合わせて下さい。
「5_3_x_comp」のところもインストールされている PHP のバージョンに一致するディレクトリを指定して下さい。
; The section name is optional, but it's always a good idea to add it, ; especially if you are not using a separate file [Zend] ; This directive needs the full path to the Zend Debugger binary zend_extension =/opt/ZendDebugger-20110410-linux-glibc23-i386/5_3_x_comp/ZendDebugger.so ; This directive allows Zend Debugger to start a debug session with: ; 127.0.0.1/32 – Zend Studio on the same computer ; 192.168.0.1/32 – Zend Studio on a computer with IP address 192.168.0.1 ; 10.0.0.0/8 – Zend Studio on any computer with IP starting with 10. zend_debugger.allow_hosts=127.0.0.1/32,192.168.0.1/32,10.0.0.0/8 ; This directive allows Zend Debugger to expose itself ; upon request (this is used in some service functionality). ; The possible options are: ; never – do not expose (default) ; always – expose to whoever wants to know ; allowed_hosts – expose only if the request comes from an IP listed above zend_debugger.expose_remotely=always
libssl.so.0.9.8 をインストール
Zend Debugger では libssl.so.0.9.8 がいるようなのでインストールします。
sudo apt-get install libssl0.9.8
インストールしないと apache2 を再起動したときに次のようなログがでます。
/var/log/apache2/error.log
Failed loading /opt/ZendDebugger-20110410-linux-glibc23-i386/5_3_x_comp/ZendDebugger.so: libssl.so.0.9.8: cannot open shared object file: No such file or directory
Zend Debugger がインストールされたことの確認
phpinfo を表示して Zend Debugger がインストールされたことを確認しましょう。
まずは apache2 を再起動します。
sudo /etc/init.d/apache2 restart
firefox で http://localhost/info.php を開きます。
Zend Engine 欄の最後の1行に
「with Zend Debugger v5.3, Copyright (c) 1999-2010, by Zend Technologies」
とあれば正常です。
手順は終了です。