在Localhost下安装Yii2 Starter Kit

我是Yii2 Frameworks的完全新手,我被推荐安装
Yii2入门套件来获取网页 快速构建框架(参见 https://github.com/trntv/yii2-starter-kit</ 一>)。 </ p>

我正在尝试使用PHPStorm和内置的Web服务器在本地开发环境中安装该工具包。 我已按照设置指南中的所有(适用)说明进行操作:</ p>

https://github.com/trntv/yii2-starter-kit/blob/master/docs/installation.md#important-notes </ a > </ p>

安装后,我似乎无法浏览任何本地主机网址(http://):</ p>

localhost:63342 / yii -starter试剂盒</ p>

本地主机:63342 / YII起动-KIT /后端</ p>

本地主机:63342 / YII起动-KIT /前端</ p>

如果我的PHPStorm启动文件夹设置为“yii-startup-kit”项目文件夹,那么也是如此:</ p>

localhost:63342 / </ p>

我似乎留下了根项目文件夹中没有index.php的安装,也没有后端或前端文件夹,因此当我浏览任何地方时,我得到“在此服务器上找不到请求的资源 “错误。 有人能告诉我我错过了什么吗? 是否需要在Vagrant / Docker(VMs?)下运行。</ p>

谢谢。</ p>

P.S。 我也看到了这个问题:部署yii2-starter-kit Yii2安装时出错</ a>,但是从我所看到的,Yii Starter套件现在可以在单域模式下工作。 </ p>
</ div>

展开原文

原文

I am a complete newbie at Yii2 Frameworks and I have been recommended to install the Yii2 Starter Kit to get a web framework up fast (see https://github.com/trntv/yii2-starter-kit).

I am trying to install the kit in a local development environment with PHPStorm and the in-built web-server. I have followed all the (applicable) instructions in the setup guide here:

https://github.com/trntv/yii2-starter-kit/blob/master/docs/installation.md#important-notes

After installation, I can't seem to browse any of my localhost urls (http://):

localhost:63342/yii-starter-kit

localhost:63342/yii-starter-kit/backend

localhost:63342/yii-starter-kit/frontend

Nor if my PHPStorm startup folder is set to the "yii-startup-kit" project folder:

localhost:63342/

I seem to be left with an installation that has no index.php in the root project folder, nor in backend or frontend folders so hence when I browse anywhere I get a "The requested resource was not found on this server" error. Could someone tell me what I am missing? Is it a requirement to run under Vagrant/Docker (VMs?).

Thank you.

P.S. I have also seen this question: Error deploying yii2-starter-kit Yii2 installation, however from what I can see, the Yii Starter kit now works in a single domain mode.

1个回答



看来(出于某种原因)Yii2-starter-kit旨在“重写”所有后端和前端URL。 这意味着PHP的简单内置服务器无法处理任务(没有做太多的小事来实现基于PHP的重写规则)。</ p>

最后,安装Apache 是使框架工作的唯一解决方案。 这需要实现“安装指南”中提到的“虚拟主机”配置。</ p>
</ div>

展开原文

原文

It appears that (for some reason) Yii2-starter-kit is designed to "rewrite" all the backend and frontend URLs. This implies that PHP's simple in-built server can't handle the task (without doing quite a bit of fiddling to implement a PHP-based rewrite rule).

In the end, installing Apache was the only solution to get the framework to work. This requires implementing the "virtual host" configuration mentioned in the Installation Guide.

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问