centos 配置php開發環境(eclipse PDT+Zend Debugger)

來源:互聯網
上載者:User
轉自:http://blog.csdn.net/yang1982_0907/article/details/39026295

一、環境說明

作業系統:CentOS 6.4 x86_64

Java:jdk-1.7.0_51

二、安裝PHP

在Shell中運行以下命令:

yum install -y php httpd
注意:在CentOS 6.4系統上通過yum安裝的PHP版本為5.3.3

三、安裝Zend Debugger

下載Zend Debugger:

cd /root/Downloads
wget http://downloads.zend.com/studio_debugger/2011_04_10/ZendDebugger-20110410-linux-glibc23-x86_64.tar.gz
注意:最新的Zend Debugger只支援PHP 5.4和5.5版本,不支援PHP 5.3.3,所以需要下載較老版本的Zend Debugger。

加壓和安裝Zend Debugger:

tar -xvzf ZendDebugger-20110410-linux-glibc23-x86_64.tar.gz
cp -a /root/Downloads/ZendDebugger-20110410-linux-glibc23-x86_64/5_3_x_comp/ZendDebugger.so /usr/lib64/php/modules/

配置Zend Debugger:

gedit /etc/php.ini
在上述檔案的[PHP]這一行下面添加如下幾行:
zend_extension=/usr/lib64/php/modules/ZendDebugger.so
zend_debugger.allow_hosts=127.0.0.1
zend_debugger.expose_remotely=always

由於CentOS 6.4的libssl和libcrypto已升級到1.0.0,而上述版本的Zend Debugger需要使用0.9.8版本,所以還需要進行如下配置:

ln -s /usr/lib64/libssl.so.10 /usr/lib64/libssl.so.0.9.8
ln -s /usr/lib64/libcrypto.so /usr/lib64/libcrypto.so.0.9.8

需要將SELinux設定為permissive模式,否則PHP將不能載入Zend Debugger:

gedit /etc/selinux/config
將上述檔案中的SELINUX=enforcing修改為SELINUX=permissive
儲存設定檔後重啟系統

四、安裝Eclipse

下載Eclipse For PHP:

cd /root/Downloads
wget http://ftp.osuosl.org/pub/eclipse/technology/epp/downloads/release/luna/R/eclipse-php-luna-R-linux-gtk-x86_64.tar.gz

解壓和安裝Eclipse For PHP:

tar -xvzf eclipse-php-luna-R-linux-gtk-x86_64.tar.gz
mv /root/Downloads/eclipse /usr/local/Eclipse4PHP

在案頭上為Eclipse建立Launcher,然後運行Eclipse,將其Workspace設定為/var/www/html

五、驗證測試

啟動Apache:

service httpd start

測試PHP是否載入Zend Debugger模組:

php -m
若上述命令沒有報錯,並且有如下資訊,則表示載入模組成功:
[Zend Modules]
Zend Debugger

在Eclipse中建立PHP測試工程,使用phpinfo()函數進行驗證,如果在頁面中看到如下資訊,則表示安裝成功:

以上就介紹了centos 配置php開發環境(eclipse PDT+Zend Debugger),包括了方面的內容,希望對PHP教程有興趣的朋友有所協助。

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.