This is an error I commonly get in CI:
Fatal error: Call to a member function result() on a non-object in /home/... on line ...
Is there any way I can get CI to output more information than this? It would be nice if it would at least output my SQL written as standard SQL not Active Record.
Thanks.
Is there any way I can get CI to output more information than this?
Check out "UhOh" written by Dan Horrigan, a port of Kohana's error handling system for Codeigniter.
https://github.com/dhorrigan/codeigniter-uhoh
http://codeigniter.com/forums/viewthread/160969/P0/
Here's a screen shot of UhOh handling a missing view file, so you can get an idea of how cool it is:
Related
I deployed my Laravel application to my web hosting site. Everything transferred successfully, but every time I login I get some message about parse syntax unexpected ? but its not telling me where its coming from this happens also on my other pages.
I'm using PHP 7.0 on my hosting site and Laravel 5.4. it will mean so much if you can help me understand what is going on. I can't provide you with a code because I don't know where the error is coming from. It doesn't tell me what line or anything. Please do not tell me the solution is in this similar question where it says "parse error" duplicate because I tried that and nothing happened
Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE)
The question marks are a feature of php 7.1. As you have said in the comments, the version on the server is only 7.0.
see http://php.net/manual/en/migration71.new-features.php for more information about this feature.
Despite of all my attempts to understand the problem, I still can't figure out what is happening.
I developped a website with Symfony 2.7 which perfectly works in dev mode. When I tested it in production mode, an error 500 is returned.
The exception is :
Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalErrorException:
"Error: Call to a member function getCacheFactory() on a non-object" at
/home/admdev-php/public_html/sfSUAPS/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php line 3039
{"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalErrorException(code: 0):
Error: Call to a member function getCacheFactory() on a non-object at
/home/admdev-php/public_html/sfSUAPS/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:3039)"} []
So I've tried to clear the cache and I had the same message :
[Symfony\Component\Debug\Exception\FatalErrorException]
Compile Error: require(): Failed opening required
'/home/stagiaire/workspace/suaps/app/cache/prod/doctrine/orm/Proxies/__CG__AppBundleEntityPlace.php'
(include_path='.:/usr/share/php:/usr/share/pear')`
I've tried to clear doctrine's cache but this doesn't solve the problem.
There are severals roles : One for students, one for teachers and one for admins. I only get this error when my role is student. So I looked closer to methods which are concerned and I commented everything related to studies and it worked. So I think the error is linked with my Entity Repository since "findBy" and "findAll" are failing.
I've took a look into Symfony's code but the error seems to be on my side. I really don't know what is going on, thank you if you can help me.
Problem solved
Turns out someone used an entity directly from cache...
Turns out someone used an entity directly from cache...
use Proxies\__CG__\AppBundle\Entity\Place;
I am setting up a Magento(v. 1.6.1.0) site.
To access the API, I needed to create a rule (Admin > System > Web Services > Rules > Add new rule).
When I click the button, I got the following error.
Fatal error: Call to a member function toHtml() on a non-object in /home/dinamal7/public_html/app/code/core/Mage/Adminhtml/Block/Api/Editroles.php on line 52
I ran some research about the issue but couldn't find any solution. Can anybody help me?
Thanks.
Sam
#Sam, looks like there is some problem with the object calling that particular function. As you can see, it is indicating the core file, which is not supposed to have any errors. You can try and replace the "core" folder of your current installation with the one extracted fresh. This should do the trick.
Is there a way in Codeigniter to override global errors. For instance if an DB error or PHP critical occurs it wont show the error itself but something like 'Our admin guy is fixing the issue' and the error is just logged and emailed.
Codeigniter lets you handle error messages your way, depending on the HTTP status.
Refer to this documentation on error handling
In addition to #Pos5e5s3dFr3ak's answer, you should handle as many errors as you can manually. For example, if you have a database error, your code should acknowledge (or 'catch') it and perhaps load the appropriate view, or pass it onto a library that will log an email the fault, instead of displaying the intended result.
This method can be used as an alternative, or as an addition to the original answer - sometimes you need not locate the error just by its HTTP response Status Code.
As an example, you may find that the database engine in use is down. If this is the case (you would have to determine if it is indeed down - ie. you are not getting the desired response), you would pass the user on to example.com/error/database, for example.
I'm trying to download a file from the internet, but I get the error -3001 back. I've been searching through google but the error doesn't appear on any website, so i have no idea what it means.
Can anyone tell me what the error code "NSURLErrorDomain error -3001" means?
Thanks
There's also a full list of all NSURL error codes here. It's very handy when you get cryptic error messages from the URL loading system.
I wrote an applescript awhile back that can search the header files for error codes. You can find the applescript here.
I ran that applescript for your error code and got this from the CFNetworkError.h file.
Error Description:
kCFURLErrorCannotOpenFile
The error comes from the fact that setDestination expects a full path with a filename:
This is wrong:
[fileDl setDestination:#"/Users/ant/ebooks/" allowOverwrite:YES];
This is right:
[fileDl setDestination:#"/Users/ant/ebooks/file.epub" allowOverwrite:YES];
So the explanation is that probably you did something like I did: specify an existing folder where you intended to put the data.
PS: the dash before 3001 prevents Google from returning any results with the request: "NSURLErrorDomain error -3001", it is parsed as: "NSURLErrorDomain and error and not 3001"..