#nginx.conf location /wx { root /wx/public/index.php; if (!-e $request_filename) { rewrite ^/wx/(.*)$ /wx/public/index.php?$1 last; } }
//public/index.php bootstrap()->run();
#conf/application.ini [product] application.directory=APP_PATH "/application/" application.dispatcher.catchException = TRUE application.dispatcher.throwException = TRUE application.modules=index,admin application.view.ext = 'php'
为什么这样配置,访问http://localhost/wx
会提示
Page was not found Failed opening controller script /home/wwwroot/default/wx/application/controllers/Wx.php: No such file or directory #0 /home/wwwroot/default/wx/public/index.php(7): Yaf_Application->run() #1 {main}
在public/index.php
打印$_REQUEST
,是个空数组
目录结构:bootstrap.php在zapplication下,入口文件index.php在public下
补充一下,把域名绑定到/home/wwwroot/default/wx,用域名是可以访问的(rewrite规则要对应修改,不是上面那个),rewrite规则改成上面那个,再使用http://ip/wx访问(wx是yaf项目目录),就不行了。会把/wx/当成控制器
终于有问Yaf
的了,真开森,楼主上下您的结构吧,是Yaf
没找到你的引导。
设定了admin
与 index
两模型,你将项目目录设定到../application/
所以您的bootstarp,php
也应该在这目录下,当bootstrap被调用的时刻, Yaf_Application就会默认的在APPLICATION_PATH下, 寻找Bootstrap.php, 而这个文件中, 必须定义一个Bootstrap类, 而这个类也必须继承自Yaf_Bootstrap_Abstract
楼主不妨在控制器下建立wx.php
尝试一下,结构有些乱哈