phalcon 访问IndexController 中只能访问indexAction方法,访问不了testAction等其它问题的解决办法

phalcon 访问IndexController 中只能访问indexAction方法,访问不了testAction,也访问不了indexAction方法,但是可以访问ArticleController里面的任意方法。访问其它方法出现这个错误“php - phalcon IndexController handler class cannot be loaded”

有人说是Apache 的rewrite问题, (如:https://www.2pea.com/?p=681 )
有人说是 nginx的rewrite配置问题,也有人说是命名空间配置的问题 (如:php - phalcon IndexController handler class cannot be loaded-PHP中文网问答php - phalcon IndexController handler class cannot be loaded-PHP中文网问答php - phalcon IndexController handler class cannot be loaded-PHP中文网问答),还有人说模块注册的问题,众说纷纭,  折腾了大半天,才发现是安全性配置的问题:  

 

//Public area resources (Plugins\Security.php) 
$publicResources = array(
    'index'      =>  array('index'),   //这里限制了只允许访问index方法了 
    'register'      =>  array('*'),
    'goods'      =>  array('*'), 
);

phalcon因为性能高、安全性高出名、但是对初学者不太友好,一定要先看官方文档!

最后修改了 Plugins\Security.php 放开了限制之后,一定要清理 cache里面的缓存(www_acl.data) 

你可能感兴趣的:(PHP,phalcon,php)