Zend Framework环境搭建
来源:互联网 发布:淘宝浏览天蓬 编辑:程序博客网 时间:2024/05/10 18:22
听说thinkphp只能做一些中小型项目,Zend Framework是官方的php框架,虽然比较复杂,但也很强大,分享一下安装过程中遇到的问题。如果你英文够好,直接推荐官网教程,本人也是根据官网教程来的。我用的环境是Windows,php用的是wampserver(集成好的MySQL,Apache与php比较方便)。
首先要安装版本控制gitb与composer,都是傻瓜式安装,没什么好讲的。安装好以后,转到wamp的网站目录下创建一个zf目录来体验一下Zend Framework框架的创建过程,比如我的目录就是D:\wampserver\wamp\www\zf。在这个空目录下单击鼠标右键打开Git Bash,用composer创建一个框架:
$ composer create-project -s dev zendframework/skeleton-application path/to/install
Do you want a minimal install (no optional packages)? Y/n
选n+EnterWould you like to install the developer toolbar? y/N
选n+EnterWould you like to install caching support? y/N
选n+EnterWould you like to install database support (installs zend-db)? y/N
选y+EnterWould you like to install forms support (installs zend-form)? y/N
选y+EnterWould you like to install JSON de/serialization support? y/NWould you like to install logging support? y/NWould you like to install MVC-based console support? (We recommend migrating to zf-console, symfony/console, or Aura.CLI) y/NWould you like to install i18n support? y/NWould you like to install the official MVC plugins, including PRG support, identity, and flash messages? y/NWould you like to use the PSR-7 middleware dispatcher? y/NWould you like to install sessions support? y/NWould you like to install MVC testing support? y/NWould you like to install the zend-di integration for zend-servicemanager? y/N
都选n+EnterUpdating root package Running an update to install optional packages...Updating application configuration... Please select which config file you wish to inject 'Zend\Db' into: [0] Do not inject [1] config/modules.config.php Make your selection (default is 0):
选1Remember this option for other packages of the same type? (y/N)
选y+Enter好像后面还有一个我选的是y+Enter,无所谓,具体意思可以看官方,或者有时间再解释
然后有四种方法连接到服务器上,我介绍两种:
1、Built-in PHP web Server
$ php -S 127.0.0.1:238 -t public public/index.php
如果出错,238可以改一下,直到出现Listening on...这时候在浏览器中访问http://127.0.0.1:238就会出现下面的成功画面,有时候可能掉线,所以要保证Listening一直在才行(wampserver要处于运行状态)
2、使用Apache
打开Apache的配置文件http.conf,或者按照我的路径找你自己的路径:D:\wampserver\wamp\bin\apache\apache2.4.18\conf
搜索到VirtualHost
找到这个文件打开,我的目录是D:\wampserver\wamp\bin\apache\apache2.4.18\conf\extra,在后面添加如下代码,DocumentRoot和Directory改成自己的public目录
<VirtualHost *:80> ServerName zf-tutorial.localhost DocumentRoot D:/wampserver/wamp/www/zf/public SetEnv APPLICATION_ENV "development" <Directory "D:/wampserver/wamp/www/zf/public"> DirectoryIndex index.php AllowOverride All Require all granted </Directory></VirtualHost>
最后修改一下c:\windows\system32\drivers\etc\的hosts文件,可能要在文件属性上添加修改权限:属性->安全->编辑在文件末尾加上下面的代码,重启Apache,访问http://zf-tutorial.localhost即可。
127.0.0.1 zf-tutorial.localhost localhost
如果出错尝试在http.conf中查找AllowOverride,改成FileInfo或者All,先说到这儿,有问题可以交流一下。
- zend framework环境搭建
- zend framework环境搭建
- Zend Framework环境搭建
- Zend Framework简单环境搭建
- zend framework开发环境搭建-windows
- redhat 6.2 搭建zend framework 开发环境
- WAMP + Zend Framework + Zend Studio For Eclipse 开发环境搭建
- WAMP + Zend Framework + Zend Studio For Eclipse 开发环境搭建
- Windows环境下从零开始Zend Framework 2.0 (ZF2)环境搭建
- zend framework 搭建
- PHP Eclipse PDT ZEND FrameWork Windos下开发环境搭建
- Zend Framework学习日记(1)--环境搭建篇
- 初学zend framework之“框架环境的搭建”
- 配置Zend framework环境
- Mac 上搭建Zend Framework
- 搭建Zend开发环境
- ZF2入门:Windows环境下从零开始Zend Framework 2.0 (ZF2)环境搭建
- ZF2入门:Ubuntu/Linux环境下从零开始Zend Framework 2.0 (ZF2)环境搭建
- B - Ignatius and the Princess III 整数拆分问题
- HTML_14_jquery_选择器
- C语言学习总结(四)——数据结构
- VirtualBox 下的 Ubuntu没有权限访问共享文件夹
- Struts 2.0
- Zend Framework环境搭建
- MPAndroidChart 教程:设置数据,设置颜色(四)
- javascript 中阶乘函数方法
- 在学校机房进行的一次内网渗透(DNS欺骗)
- hdu 1171 普通母函数
- 【Python】批量直接修改图片存储大小脚本
- floating IP 原理分析 - 每天5分钟玩转 OpenStack(107)
- 网页单选框select
- 基于Qt 5.7 自己写一个漂亮的串口助手