在Linux(CentOS)上安装搭建zend framework2运行环境

2014年02月19日

在Linux上安装搭建Zend Framework2的运行环境我们需要先安装PHP的运行环境。
关于Linux(CentOS)的安装,请点击这里。安装Linux(Centos6)服务器
关于Linux(CentOS)上PHP的运行环境,请点击在Linux(CentOS6)上搭建Apache2+Mysql5+PHP5开发环境。
如果在虚拟主机上运行,请点击Apache添加配置虚拟主机(VirtualHost)

Zend Framework2 搭建步骤

1. 下载ZendSkeletonApplication到站点根目录下,这里是虚拟主机根目录。

这里使用git版本管理工具获取ZendSkeletonApplication,也可以从GitHub直接下载,解压,拷贝。
https://github.com/zendframework/ZendSkeletonApplication

[root@qiais qi]# git clone git://github.com/zendframework/ZendSkeletonApplication.git public_html
Initialized empty Git repository in /home/qi/public_html/.git/
remote: Reusing existing pack: 2429, done.
remote: Total 2429 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (2429/2429), 1.40 MiB | 18 KiB/s, done.
Resolving deltas: 100% (1061/1061), done.
[root@qiais qi]# pwd
/home/qi
[root@qiais qi]# chmod -R 755 public_html/
[root@qiais public_html]# 
 

2. 使用Composer:下载Zend Framework需要的相关包。

[root@qiais qi]# cd public_html/
[root@qiais public_html]# pwd
/home/qi/public_html
[root@qiais public_html]# php composer.phar self-update
Updating to version 432ace33d4216ecb3e3082d53cf06907dc329663.
    Downloading: 100%         
Use composer self-update --rollback to return to version 7adc41d02c3536b3e19a6b906cf0c4cf6d3beb70
[root@qiais public_html]# php composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev)
  - Installing zendframework/zendframework (2.2.5)
    Downloading: 100%         

zendframework/zendframework suggests installing ext-intl (ext/intl for i18n features (included in default builds of PHP))
zendframework/zendframework suggests installing doctrine/annotations (Doctrine Annotations >=1.0 for annotation features)
zendframework/zendframework suggests installing ircmaxell/random-lib (Fallback random byte generator for Zend\Math\Rand if OpenSSL/Mcrypt extensions are unavailable)
zendframework/zendframework suggests installing ocramius/proxy-manager (ProxyManager to handle lazy initialization of services)
zendframework/zendframework suggests installing zendframework/zendpdf (ZendPdf for creating PDF representations of barcodes)
zendframework/zendframework suggests installing zendframework/zendservice-recaptcha (ZendService\ReCaptcha for rendering ReCaptchas in Zend\Captcha and/or Zend\Form)
Writing lock file
Generating autoload files
[root@qiais public_html]# 

3. 确认

访问主机首页,应该能看到如下界面了。

449-1