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.
Related
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
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,
I tried the Example CLI PHP code from Google. The listFiles() method throws a 500 Internal Error from Google's servers, as shown in the stack trace:
bash-4.2$ php test.php
PHP Fatal error: Uncaught exception 'Google_Service_Exception' with message 'Error calling GET https://www.googleapis.com/drive/v2/files?maxResults=10: (500) Internal Error' in /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php:79
Stack trace:
#0 /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php(44): Google_Http_REST::decodeHttpResponse(Object(Google_Http_Request))
#1 /home/ben/.../vendor/google/apiclient/src/Google/Client.php(556): Google_Http_REST::execute(Object(Google_Client), Object(Google_Http_Request))
#2 /home/ben/.../vendor/google/apiclient/src/Google/Service/Resource.php(195): Google_Client->execute(Object(Google_Http_Request))
#3 /home/ben/.../vendor/google/apiclient/src/Google/Service/Drive.php(1783): Google_Service_Resource->call('list', Array, 'Google_Service_...')
#4 /home/ben/.../test.php(78): Google_Service_Drive_Files_Resource->listFiles(Arra in /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php on line 79
I deleted the saved credentials and tried again. That did not help:
bash-4.2$ php test.php
Open the following link in your browser:
https://accounts.google.com/o/oauth2/auth?response_type=code&redirect_uri=urn%3A
ietf%3Awg%3Aoauth%3A2.0%3Aoob&client_id=...&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.metadata.readonly&access_type=offline&approval_prompt=auto
Enter verification code: ...
Credentials saved to /home/ben/.credentials/drive-php-quickstart.json
PHP Fatal error: Uncaught exception 'Google_Service_Exception' with message 'Error calling GET https://www.googleapis.com/drive/v2/files?maxResults=10: (500) Internal Error' in /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php:79
Stack trace:
#0 /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php(44): Google_Http_REST::decodeHttpResponse(Object(Google_Http_Request))
#1 /home/ben/.../vendor/google/apiclient/src/Google/Client.php(556): Google_Http_REST::execute(Object(Google_Client), Object(Google_Http_Request))
#2 /home/ben/.../vendor/google/apiclient/src/Google/Service/Resource.php(195): Google_Client->execute(Object(Google_Http_Request))
#3 /home/ben/.../vendor/google/apiclient/src/Google/Service/Drive.php(1783): Google_Service_Resource->call('list', Array, 'Google_Service_...')
#4 /home/ben/.../test.php(78): Google_Service_Drive_Files_Resource->listFiles(Arra in /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php on line 79
I searched through the github issues and stackoverflow questions tagged google-api-php-client, but did not find any clues. I logged into the developer console and clicked Logs, which resulted in the text
Failed to load.
Any ideas how to get more detailed information about 500 errors from Google?
try adding this to the beginning of the code in the file calling Google Drive API
date_default_timezone_set('America/New_York') //change timezone you want
Also make sure, folder permission inside the google drive is set.
A normal thrown and uncaught exception in PHP will produce output similar to this:
Fatal error: Uncaught exception 'Exception' with message 'Insufficient permissions or something' in /home/codemonkey/foo/bar/File.php:143
Stack trace:
#0 /home/codemonkey/dev/foo/bar/SomeOtherFile.php(85): foo\bar\File::fromUpload(Array)
#1 /home/codemonkey/dev/foo/bar/OmniDataFileImport.php(35): foo\bar\OmniDataFileImport->performFileImportLogic()
#2 [internal function]: foo\bar\OmniDataFileImport->post(Object(Request), false)
#3 /home/codemonkey/dev/foo/vendor/tonic/lib/tonic.php(654): call_user_func_array(Array, Array)
#4 /home/codemonkey/dev/foo/dispatch.php(22): Resource->exec(Object(Request))
#5 {main}
thrown in /home/codemonkey/dev/foo/broadnet/files/File.php on line 143
The message and stack trace is cool, but I would really like more information. For that reason I want to extend the Exception with more information such as local variables and their values. The problem is that PHP will probably still output the same above information but with the text "Uncaught exception 'MyException'" instead.
Can I override the way PHP displays uncaught exceptions? I recall reading about a function in PHP that you can set as a backup to catch all uncaught exceptions. Perhaps I can use that functionality to format my own message and kill the process.
Thanks for all helpful information on the topic
You are looking for set_exception_handler().
However, you cannot retrieve local variables etc. - PHP's error handling/debugging is rather poor unless you use a debugging extension which is not suitable for a production system.
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.