Uncaught exception 'Zend_Acl_Exception' with message 'Resource not found' - php

I am new to Zend Framework and I am trying to build a small website using it. So to build CMS I found one source code that is on Apress website of author Forrest Lyman. I also got the book from local market.
I wanted to have admin module separately so I have created admin module but I got problem in that I am not able to access controller other than IndexController. When I try to access other controller in admin module I am getting this error:
Fatal error: Uncaught exception 'Zend_Acl_Exception' with message 'Resource 'category' not found' in C:\Server\Zend\ZendServer\share\ZendFramework\library\Zend\Acl.php:365 Stack trace: #0 C:\Server\Zend\ZendServer\share\ZendFramework\library\Zend\Acl.php(846): Zend_Acl->get('category') #1 C:\Server\Zend\Apache2\htdocs\cms\library\CMS\Controller\Plugin\Acl.php(52): Zend_Acl->isAllowed('administrator', 'category', 'index') #2 C:\Server\Zend\ZendServer\share\ZendFramework\library\Zend\Controller\Plugin\Broker.php(309): CMS_Controller_Plugin_Acl->preDispatch(Object(Zend_Controller_Request_Http)) #3 C:\Server\Zend\ZendServer\share\ZendFramework\library\Zend\Controller\Front.php(941): Zend_Controller_Plugin_Broker->preDispatch(Object(Zend_Controller_Request_Http)) #4 C:\Server\Zend\ZendServer\share\ZendFramework\library\Zend\Application\Bootstrap\Bootstrap.php(97): Zend_Controller_Front->dispatch() #5 C:\Server\Zend\ZendServer\share\ZendFramework\library\Zend\Application.php(366): Zend_Application_Bootstrap_Bootstrap->run() #6 in C:\Server\Zend\ZendServer\share\ZendFramework\library\Zend\Controller\Plugin\Broker.php on line 312

I found the solution..
After making a controller, I have to add resources in Acl.php file which is located in (library/CMS/Controller/Plugin/).
Just add this in add resources section
$acl->add(new Zend_Acl_Resource('category'));
Then you can access it.
Thanks.

Related

Create subdomain by cpanel api

I register on youhosting.com and use domain that registered on godaddy.com. I want to create new subdomain by programming. I have already see the tutorial on cPanel Documentation 1 and Doc 2
After I implement it, it show errors :
Fatal error: Uncaught exception 'Exception' with message 'curl_exec threw error "couldn't connect to host" for https://bodoamat.com:2087/xml-api/listips?' in /home/u937182156/public_html/xmlapi.php:748 Stack trace: #0 /home/u937182156/public_html/xmlapi.php(666): xmlapi->curl_query('https://bodoama...', '', 'Authorization: ...') #1 /home/u937182156/public_html/xmlapi.php(2055): xmlapi->xmlapi_query('listips') #2 /home/u937182156/public_html/listips_example.php(44): xmlapi->listips() #3 {main} thrown in /home/u937182156/public_html/xmlapi.php on line 748
include 'xmlapi.php';
$ip='127.0.0.1';
$root_pass='mypassword';
$xmlapi = new xmlapi($host);
$xmlapi->set_port(2082);
$xmlapi->password_auth($my_user, $my_pass);
$xmlapi->set_debug(1);
print $xmlapi->api1_query($account, "Subdomain", "addsubdomain", array('user123', 'bodoamat.com'));
Any one may help me?
Thanks before
$xmlapi->api1_query($cpanelusr, 'SubDomain', 'addsubdomain', array('user123','bodoamat.com',0,0, '/public_html/directory_name'))

Laravel 4 Log Errors: NotFoundHttpException

I have the following appearing in my log files and being a new comer to Laravel, I'm not sure where to start debugging. Any assistance would be appreciated.
[2013-12-23 01:04:41] log.ERROR: exception 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException' in /home/ulti/laravel4/bootstrap/compiled.php:5125
Stack trace:
#0 /home/ulti/laravel4/bootstrap/compiled.php(4970): Illuminate\Routing\Router->handleRoutingException(Object(Symfony\Component\Routing\Exception\ResourceNotFoundException))
#1 /home/ulti/laravel4/bootstrap/compiled.php(4958): Illuminate\Routing\Router->findRoute(Object(Illuminate\Http\Request))
#2 /home/ulti/laravel4/bootstrap/compiled.php(534): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#3 /home/ulti/laravel4/bootstrap/compiled.php(521): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request))
#4 /home/ulti/public_html/index.php(49): Illuminate\Foundation\Application->run()
#5 {main} [] []
All this means is that you visited a route that doesn't exist.
This means you have an invalid route. This is saying "Hey this page doesn't exist!". The page might exist but due to how routes are defined, and that controllers aren't routed automatically, it may not function as you expect. Can you post the code that has your routes, and also the URL you're trying to go to on site? That would be a start to help you with debugging! :)

Integrating Search-SphinxsearchBundle into Symfony

I'm using Symfony-standard,
I have installed Search-SphinxsearchBundle
I was assuming, i would use it's services in controller, to fetch documentation in my app/Resources/docs, where there's index.srt, I need to know how to direct the bundle to search from my folder.
I want to use it to query my index.srt documentations in app/Resources/docs.
I'm stuck on app/config/config.yml
sphinxsearch:
indexes:
- name: books
index:
- %sphinxsearch_index_books%
field_weights:
label: 10
content: 5
I'm getting this error:
Fatal error: Uncaught exception 'Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException'
with message 'You have requested a non-existent parameter "sphinxsearch_index_pages".'
in /usr/local/dev/hris/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php:108 Stack trace:
#0 /usr/local/dev/hris/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php(234): Symfony\Component\DependencyInjection\ParameterBag\ParameterBag->get('sphinxsearch_in...')
#1 /usr/local/dev/hris/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php(205): Symfony\Component\DependencyInjection\ParameterBag\ParameterBag->resolveString('%sphinxsearch_i...', Array)
#2 /usr/local/dev/hris/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php(195): Symfony\Component\DependencyInjection\ParameterBag\ParameterBag->resolveValue('%sphinxsearch_i...', Array)
#3 /usr/local/dev/hris/vendo in /usr/local/dev/hris/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php on line 108

Yii framework - controller actions

I am trying to create sample project in yii but I am having this problem while trying to run my code:
CHttpException
The system is unable to find the requested action "error". (C:\wamp\www\yii\framework\web\CController.php:484)
#0 C:\wamp\www\yii\framework\web\CController.php(271): CController->missingAction('error')
#1 C:\wamp\www\yii\framework\web\CWebApplication.php(276): CController->run('error')
#2 C:\wamp\www\yii\framework\base\CErrorHandler.php(310): CWebApplication->runController('site/error')
#3 C:\wamp\www\yii\framework\base\CErrorHandler.php(183): CErrorHandler->render('error', Array)
#4 C:\wamp\www\yii\framework\base\CErrorHandler.php(108): CErrorHandler->handleException(Object(CHttpException))
#5 C:\wamp\www\yii\framework\base\CApplication.php(713): CErrorHandler->handle(Object(CExceptionEvent))
#6 [internal function]: CApplication->handleException(Object(CHttpException))
#7 {main}
Can anyone tell me the reason ? As I think this is not the problem of my code.
An exception has occurred (most likely due to a bug or misconfiguration) and Yii attempted to run the error handler, which in this case is the error action on the site controller.
The error occurs because you do not have a site controller, or it does not have an error action.

Zend Framework Create Custom View Helper?

I have tried multiple fixes but none have worked. I am getting this error:
Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception'
with message 'Plugin by name 'AddCss' was not found in the registry;
used paths: Zend_View_Helper_:
Zend/View/Helper/:/Users/cgunnels/dev/git/rove-git/application/views/helpers/'
in
/usr/local/zend/share/ZendFramework/library/Zend/Loader/PluginLoader.php:412
Stack trace: #0
/usr/local/zend/share/ZendFramework/library/Zend/View/Abstract.php(1182):
Zend_Loader_PluginLoader->load('AddCss') #1
/usr/local/zend/share/ZendFramework/library/Zend/View/Abstract.php(618):
Zend_View_Abstract->_getPlugin('helper', 'addCss') #2
/usr/local/zend/share/ZendFramework/library/Zend/View/Abstract.php(344):
Zend_View_Abstract->getHelper('addCss') #3
/Users/cgunnels/dev/git/rove-git/application/layouts/scripts/layout.phtml(6):
Zend_View_Abstract->__call('addCss', Array) #4
/Users/cgunnels/dev/git/rove-git/application/layouts/scripts/layout.phtml(6):
Zend_View->addCss(Array) #5
/usr/local/zend/share/ZendFramework/library/Zend/View.php(108):
include('/Users/cgunnels...') #6 /usr in
/usr/local/zend/share/ZendFramework/library/Zend/Controller/Plugin/Broker.php
on line 336
this is my class:
class Zend_View_Helper_Css extends Zend_View_Helper_Abstract {
public function css() {
die("test");
}
}
I followed the instructions on this page http://framework.zend.com/manual/en/zend.view.helpers.html and it doesn't work.
I also added this to my application.ini:
resources.view.helperPath = APPLICATION_PATH "/views/helpers"
Please help me out, thanks
answer provided by author:
I fixed it. So the filename was CssHelper.php I changed it to Css.php
and it worked. – chris gunnels

Categories