文章目錄
- 設定Apache HTTPD
- 安裝Zend Server CE
- 安裝Zend Eclipse PDT
因為需要做一些PHP的開發,這時候通常會選擇Zend Server CE和Zend Eclipse PDT。
設定Apache HTTPD
httpd預設是和CentOS一起安裝的。其配置目錄是/etc/httpd,網站目錄/var/www。我們可以將它配置成開機啟動。
# chkconfig httpd on# service httpd restart
安裝Zend Server CE
1. 配置Zend軟體源。建立檔案/etc/yum.repos.d/zend.repo,內容如下:
[Zend]name=Zend Serverbaseurl=http://repos.zend.com/zend-server/rpm/$basearchenabled=1gpgcheck=1gpgkey=http://repos.zend.com/zend.key[Zend_noarch]name=Zend Server - noarchbaseurl=http://repos.zend.com/zend-server/rpm/noarchenabled=1gpgcheck=1gpgkey=http://repos.zend.com/zend.key
2. 安裝之前需要設定一下SELinux許可權,否則啟動httpd服務時會提示許可權錯誤。
# setenforce permissive
3. 安裝Zend Server CE。可以先查詢一下軟體源提供了什麼版本:
# yum list --disablerepo=* --enablerepo=Zend* | grep zend-server-cezend-server-ce-php-5.2.noarchzend-server-ce-php-5.3.noarch
選擇自己需要的版本然後安裝:
# yum install zend-server-ce-php-5.3
4. 啟動zend-server守護進程。
# chkconfig zend-server on# service zend-server restart
5. 測試zend server。
# cat > /var/www/html/index.php<?phpphpinfo();?>
用瀏覽器查看該頁面:
6. 加入Zend Server CE安裝路徑到系統內容變數。
# echo 'export PATH=$PATH:/usr/local/zend/bin' >> /etc/profileecho 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/zend/lib' >> /etc/profile
更多關於安裝Zend Server的資訊請參考《RPM Installation (RHEL, CentOS, Fedora and OEL)》。
安裝Zend Eclipse PDT
Zend Eclipse PDT和Zend Server CE配合在一起,可以大大簡化我們配置PHP開發環境的過程。
安裝非常簡單:下載Zend Eclipse PDT的壓縮包,解開,執行包裡面的eclipse-php就可以了。
# tar xvf ~/eclipse-php-3.0.2.v20120611144-x86_64.tar.gz# chown -R root:root eclipse-php# cd eclipse-php# ./eclipse-php
為了方便啟動,可以在頂部面板增加啟動項。可以到EasyIcon.cn下載一個Eclipse的表徵圖,png格式的,32和48尺寸都可以。
更多關於LAMP環境的設定請參考:
《安裝Apache+MySQL+PHP基本環境》
《使用phpMyAdmin管理MySQL》
《遠端連線MySQL》