Mercy_stone

Mercy_stone

这家伙有点懒,还没写个性签名!

  • 财富值110
  • 威望值30
  • 总积分510

个人信息

  • 回复了 的评论

    补充:
    1、第一步是换composer中国镜像,不然速度会呵呵的。参考 http://pkg.phpcomposer.com/

    2、第二步是

    php composer.phar global require "fxp/composer-asset-plugin:~1.1.1"
    

    安装这个玩意儿,不然你会发现新增加好的项目中没有vendor目录

    3、在

    php composer.phar create-project --prefer-dist yiisoft/yii2-app-advanced advanced
    

    前最好有github账号,需要授权拉取的,不然。。。。

    别问我怎么知道的,这些坑我都爬过了

    点个赞!!

  • 赞了评论

    补充:
    1、第一步是换composer中国镜像,不然速度会呵呵的。参考 http://pkg.phpcomposer.com/

    2、第二步是

    php composer.phar global require "fxp/composer-asset-plugin:~1.1.1"
    

    安装这个玩意儿,不然你会发现新增加好的项目中没有vendor目录

    3、在

    php composer.phar create-project --prefer-dist yiisoft/yii2-app-advanced advanced
    

    前最好有github账号,需要授权拉取的,不然。。。。

    别问我怎么知道的,这些坑我都爬过了

  • 回复了 的回复

    我用的apache,Yii2的basic模板,但是出现“The requested URL /site/about was not found on this server.”这种错误是为什么?我在apache里配置了虚拟主机

    <VirtualHost *:80>
        DocumentRoot "D:\wamp\www\basic\web"
        DirectoryIndex index.php
        ServerName www.test.com
    </VirtualHost>
    
    <Directory "D:\wamp\www\basic\web">
      Options Indexes FollowSymLinks
      AllowOverride All
      Order allow,deny
      Allow from all
    </Directory>
    

    index.php同级目录下创建了.htaccess文件,内容是

    Options +FollowSymLinks
    IndexIgnore */*
    RewriteEngine on
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    
    RewriteRule . index.php
    

    我是哪里配错了么?

    你配置好backend或者frontend的config-》main.php了吗,里面需要把components项的urlManager设置enablePrettyUrl=>true,showscriptName=>false,就是不显示index了,最后在脚本入口index.php同级目录下新建一个.htaccess文件,内容如楼上,就可以了

  • DocumentRoot "D:\wamp\www\back-first\frontend\web" ServerName www.demo.com ServerAlias www.demo.com ErrorLog "logs/dummy-host.example.com-error.log" CustomLog "logs/dummy-host.example.com-access.log" common DocumentRoot "D:\wamp\www\back-first\backend\web" ServerName admin.demo.com ServerAlias admin.demo.com ErrorLog "logs/dummy-host2.example.com-error.log" CustomLog "logs/dummy-host2.example.com-access.log" common

    就是按照这个配置的httpd-vhosts.conf,从新安装一个新的advanced 再配置就能打开。但是从远程仓库pull下来的打不开

  • <VirtualHost *:80>
      
        DocumentRoot "D:\wamp\www\back-first\frontend\web"
        ServerName www.demo.com
        ServerAlias www.demo.com
        ErrorLog "logs/dummy-host.example.com-error.log"
        CustomLog "logs/dummy-host.example.com-access.log" common
    </VirtualHost>
    
    <VirtualHost *:80>
       
        DocumentRoot "D:\wamp\www\back-first\backend\web"
        ServerName admin.demo.com
    	ServerAlias admin.demo.com
        ErrorLog "logs/dummy-host2.example.com-error.log"
        CustomLog "logs/dummy-host2.example.com-access.log" common
    </VirtualHost>
    

    就是按照这个配置的httpd-vhosts.conf,从新安装一个新的advanced 再配置就能打开。但是从远程仓库pull下来的打不开

主管 等级规则
510/1000
资料完整度
10/100
用户活跃度
0/100

Ta的关注

1

Ta的粉丝

5

Ta的访客

2