我似乎无法开始使用Zend框架2骨架应用 [英] I can't seem to get started with Zend Framework 2 skeleton app
问题描述
我下通过了Zend主页入门骨架应用教程:
I'm following through the getting started skeleton app tutorial on the Zend homepage:
http://framework.zend.com/手动/ 2.2 / EN /用户指南/骨架application.html
我得尽可能能够进入到浏览器的地址栏中输入ZF2-tutorial.localhost /和我的Zend欢迎页面应该出现。这不,在Apache Web文件夹(在/ var / WWW)目录显示代替。如果我输入 HTTP://zf2-tutorial.localhost/1234 ,以测试是否在Zend 404页看来,事实并非如此。出现默认的Apache找不到网页。
I've got as far as being able to enter into the browser address bar "zf2-tutorial.localhost/" and my Zend welcome page should appear. It doesn't, the apache web folder (/var/www) directory appears instead. If I enter "http://zf2-tutorial.localhost/1234" to test whether the Zend 404 page appears, it doesn't. The default apache Not Found page appears.
我在终端运行时创建我的应用程序:
I created my app by running in terminal:
php composer.phar create-project --repository-url="http://packages.zendframework.com" zendframework/skeleton-application:dev-master /var/www/zf2-tutorial
..这创造了所需的文件夹(在/ var / WWW / ZF2教程)。
.. this created all the files in the desired folder (/var/www/zf2-tutorial).
然后我创建的文件的/ etc / apache2的/启用站点-/ ZF2教程
通过以下内容:
I then created the file /etc/apache2/sites-enabled/zf2-tutorial
with the following:
<VirtualHost *:80>
ServerName zf2-tutorial.localhost
DocumentRoot /var/www/zf2-tutorial/public
SetEnv APPLICATION_ENV "development"
<Directory /var/www/zf2-tutorial/public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
我更新了我的 / etc / hosts中
与文件:
127.0.0.1 zf2-tutorial.localhost localhost
我重新启动Apache的
I restarted apache
sudo service apache2 restart
..通过这一点,我应该能看到Zend的欢迎页面,所以我可以与教程,但没有其余继续。
.. and by this point I should be able to see the Zend welcome page so I can proceed with the rest of the tutorial but nothing.
顺便说一句,我使用Ubuntu 12.04,阿帕奇/ 2.4.9(Ubuntu的)和PHP 5.5.14。
By the way, I'm using Ubuntu 12.04, Apache/2.4.9 (Ubuntu) and PHP 5.5.14.
有什么明显的,我已经错过了?我有这事做的mod_rewrites的感觉,但我有点困惑,我应该更新,以及如何。任何帮助将是非常美联社preciated。
Is there anything obvious that I've missed out? I've got a feeling that it has something to do with the mod_rewrites but I'm a little confused which I should be updated and how. Any help would be much appreciated.
推荐答案
添加
<VirtualHost *:80>
[... same code ....]
</VirtualHost>
在的/ etc / apache2的/网站启用/ 000-默认
文件并重新启动的Apache2
更新 -
如果仍然无法正常工作,然后尝试下面的命令并检查 -
If it still doesn't work then try the below command and check -
须藤a2enmod重写
须藤服务的Apache2重启
这将使重写
模块如果不是已经是了。
This will enable the rewrite
module if not already is.
在浏览器中输入URL,如果没有显示所需页面,然后检查位于 /var/log/apache2/error.log $ C Apache的错误日志文件后$ C>
这样,你可以得到一些主意,因为它的地方去错了。
By this, you could get some idea as where its going wrong.
这篇关于我似乎无法开始使用Zend框架2骨架应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!