Cakephp Fatal Error not showing exact issue - php

Im building an application, and when I'm writing code sometimes I get a Fatal error because of bad typo.
But CakePHP only shows Fatal Error in the Error Handler:
Error: Uncaught TypeError: Argument 1 passed to Cake\Error\BaseErrorHandler::handleException() must be an instance of Exception, instance of ParseError given in C:\wamp\www\otras\becrm\vendor\cakephp\cakephp\src\Error\BaseErrorHandler.php:153 Stack trace: #0 [internal function]: Cake\Error\BaseErrorHandler->handleException(Object(ParseError)) #1 {main} thrown
File C:\wamp\www\otras\becrm\vendor\cakephp\cakephp\src\Error\BaseErrorHandler.php
Line: 153
Is there a way that it shows me something like Error in File "AppController" Line 53? Where the real problem is?
error level in config/app is 'errorLevel' => E_ALL & ~E_DEPRECATED,

Related

Magento 2 crash after changing to dev mode

Need help for telling me what that error is so I will have an idea what to do or if someone can tell me way to fix it.
This is the error I am getting when switching to developer mode and website crashing.
PHP Fatal error: Uncaught Magento\Framework\Exception\LocalizedException: Invalid Document
Element 'config', attribute 'xsi:noNamespaceSchemaLocation': The attribute 'xsi:noNamespaceSchemaLocation' is not allowed.
Line: 2
in /home/software/public_html/vendor/magento/framework/Config/Reader/Filesystem.php:160
Stack trace:
#0 /home/software/public_html/vendor/magento/framework/Config/Reader/Filesystem.php(127): Magento\Framework\Config\Reader\Filesystem->_readFiles(Object(Magento\Framework\Config\FileIterator))
#1 /home/software/public_html/vendor/magento/framework/App/ObjectManager/ConfigLoader.php(69): Magento\Framework\Config\Reader\Filesystem->read('global')
#2 /home/software/public_html/vendor/magento/framework/App/ObjectManager/Environment/Developer.php(77): Magento\Framework\App\ObjectManager\ConfigLoader->load('global')
#3 /home/software/public_html/vendor/magento/framework/App/ObjectManagerFactory.php(194): Magento\Framework\App\ObjectManager\Environment\Developer->configureObjectManager(Object(Magento\Framework\Inte in /home/software/public_html/vendor/magento/framework/Config/Reader/Filesystem.php on line 160

Fatal error because an Error instance is being passed instead of an expected Exception instance

I just installed xampp with php 7.0.4 and a fresh cakephp 3.2.6.
I did a lot of research and everything I found shows that they are compatible.
However as soon as I go to open the application with a browser, cake replies with an Internal Error.
The only pointer as to what to do is that xampp logs the following in apache error.log:
PHP Fatal error: Uncaught TypeError: Argument 1 passed to Cake\Error\BaseErrorHandler::handleException() must be an instance of Exception, instance of Error given in D:\Xampp\htdocs\cakephp\vendor\cakephp\cakephp\src\Error\BaseErrorHandler.php:153
Stack trace:
#0 [internal function]: Cake\Error\BaseErrorHandler->handleException(Object(Error))
#1 {main} thrown in D:\Xampp\htdocs\cakephp\vendor\cakephp\cakephp\src\Error\BaseErrorHandler.php on line 153
I tried php 5.6 but it still shows the error in the log.
If that's the error that you are encountering, then I'd doubt that you are using CakePHP 3.2.6, as line 153 is in the middle of a comment
https://github.com/cakephp/cakephp/blob/3.2.6/src/Error/BaseErrorHandler.php#L153
PHP7 errors are handled since CakePHP 3.1.5, so check your CakePHP dependency, and make sure it's actually up to date.

Fatal Error on website

I had to upgrade our website Open Cart from 1.5.5.1 to 2.0.1.1 because our hosting company decided to upgrade the PHP. Now the website does not work anymore and gives a fatal error. I don't understand anything from this fatal error code:
Fatal error: Uncaught exception 'Exception' with message 'error_theme_option_file_lost' in /public/sites/www.hippehangmatten.nl/catalog/model/kuler/cp.php:40
Stack trace:
#0 /public/sites/www.hippehangmatten.nl/system/modification/catalog/controller/module/kuler_cp.php(2157): ModelKulerCp->loadThemeOptions(NULL)
#1 /public/sites/www.hippehangmatten.nl/system/modification/catalog/controller/module/kuler_cp.php(2966): Kuler->processStyles()
#2 /public/sites/www.hippehangmatten.nl/system/modification/system/library/response.php(63): Kuler->processOutput('...')
#3 /public/sites/www.hippehangmatten.nl/index.php(266): Response->output()
#4 {main} thrown in /public/sites/www.hippehangmatten.nl/catalog/model/kuler/cp.php on line 40
I hope that somebody can help me to fix this problem. The designer of this theme ended their company, so I am not able to reach out to them.

Zend Stack Trace not showing up due to fatal error

I have a Zend 1.11 application that is giving me a similar fatal error when any error exists
The Error is as follows:
Fatal error: Uncaught exception 'Zend_Mail_Protocol_Exception' with message 'No connection could be made because the target machine actively refused it. ' in C:\xampp\php\pear\Zend\Mail\Protocol\Abstract.php:277
Stack trace:
#0 C:\xampp\php\pear\Zend\Mail\Protocol\Smtp.php(167): Zend_Mail_Protocol_Abstract->_connect('tcp://localhost...')
#1 C:\xampp\php\pear\Zend\Mail\Transport\Smtp.php(199): Zend_Mail_Protocol_Smtp->connect()
#2 C:\xampp\php\pear\Zend\Mail\Transport\Abstract.php(348): Zend_Mail_Transport_Smtp->_sendMail()
#3 C:\xampp\php\pear\Zend\Mail.php(1194): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail))
#4 C:\xampp\htdocs\test2\application\modules\default\controllers\ErrorController.php(153): Zend_Mail->send()
#5 C:\xampp\htdocs\test2\application\modules\default\controllers\ErrorController.php(66): Default_ErrorController->SendMail('Application err...', 'An error oc...')
#6 C:\xampp\php\pear\Zend\Controller\Action.php(516): Default_ErrorController->errorAction()
#7 C:\xampp\php\pear\Zend\Controller\Disp in C:\xampp\php\pear\Zend\Controller\Plugin\Broker.php on line 336
This is preventing the correct stack trace from showing up (i.e this error came from an intentional misnaming of the database which would normally throw an unknow DB exception) and there is'nt really anything to do with mail on this PHP application. Any advice would help. Thanks
On reviewing your callstack, it's the ErrorController within your application which is throwing the error.
I would guess it's trying to e-mail you the error details, rather than throwing the exception.
This obviously needs to be fixed, but to see your error now try adding this into your application.ini
resources.frontController.params.displayExceptions = 1
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
phpSettings.error_reporting = "8191"
resources.frontController.throwExceptions = true
This will throw any errors to screen, rather than trying to handle them.

Google Api Oath Exception Issues

I am newer to the Google Plus Api, but I have followed each and every rule to integrate G-Plus API in my WEB. But every time I get stuck at the issue:
Fatal error: Uncaught exception 'apiAuthException' with message 'Error refreshing the OAuth2 token, message: ''' in C:\AppServ\www\googleplus-source\google-api-php-client\src\auth\apiOAuth2.php:203
Stack trace:
#0 C:\AppServ\www\googleplus-source\google-api-php-client\src\io\apiCurlIO.php(51): apiOAuth2->sign(Object(apiHttpRequest))
#1 C:\AppServ\www\googleplus-source\google-api-php-client\src\io\apiREST.php(55): apiCurlIO->authenticatedRequest(Object(apiHttpRequest))
#2 C:\AppServ\www\googleplus-source\google-api-php-client\src\service\apiServiceResource.php(148): apiREST::execute(Object(apiServiceRequest))
#3 C:\AppServ\www\googleplus-source\google-api-php-client\src\contrib\apiPlusService.php(204): apiServiceResource->__call('get', Array)
#4 C:\AppServ\www\googleplus-source\google-plus-access.php(40): PeopleServiceResource->get('me')
#5 C:\AppServ\www\googleplus-source\index.php(2): include_once('C:\AppServ\www\...')
#6 {main} thrown in C:\AppServ\www\googleplus-source\google-api-php-client\src\auth\apiOAuth2.php on line 203
What could be the reason for this error?
What could be the reason for this error?
The reason for this error (a Fatal error) is given in the error message: Uncaught exception. That means an exception­Docs has been thrown and was not caught. This results in a fatal error.
Most likely in your case, the root cause of the problem highlighted in the exception message is misconfiguration and/or wrong API usage. As you have not posted any code in your question, you should read the API documentation first and double check your usage of the API and it's configuration.

Categories