Zend framework not showing errors - zend-framework

I read via this post how to turn on error reporting in Zend Framework but WHERE exactly do you put these statements? I've tried in public/index.php, in the file I'm working in, initializer.php but nothing prints out errors, always just a blank screen.
It's beyond me why a framework would come with a setting like this by default. Anyone know how I can see my php errors?

You should put the code in the beginning of your script which is executed when URL is called.
If the url is www.example.com, put the lines at the beginning of index.php.
If it's www.example.com/news.php, put it in news.php
This is actually not a question of Zend Framework, rather your php.ini settings.
Check out this php.ini settings

To show errors in zend framework
error_reporting(E_ALL|E_STRICT);
ini_set('display_errors', 'on');

Related

Joomla! Too Many Redirects

I'm trying to build a website (it's not my first time), using latest version of Joomla! (3.8.10), but I have a problem - tabs in the main menu don't work. When I try to go to other page, I have an error:
ERR_TOO_MANY_REDIRECTS
I almost solved this problem by changing:
$sef="1"
to
$sef="0"
in configuration.php, but it caused strangely long addresses.
Ok, I found the solution. Need to add:
$_SERVER['HTTPS']='on';
in index.phpfile, behind the <?php
Maybe someone will use it.
This is most likely a problem with your .htaccess file. When you change $sef=0, you are basically telling the system to not use your .htaccess file. I suggest backing up your current one and replacing with the default Joomla one. It is the one that comes in the download package and is named htaccess.txt. Upload and rename to .htaccess to overwrite existing.

JSF 2.2 misspelled redirect doesn't generate an error

I'm converting an app written in JSF 1.1/ADF faces to JSF 2.2 (Mojarra) /Primefaces and converting all of the faces-config navigations to inplace (implicit?).
I just spent two hours debugging why the redirect:
"blahbla?faces-redirect=true"
wasn't working. Turns out it was supposed to be
"blahblah?faces-redirect=true"
I'm not sure why I didn't get some sort of error. Web developer didn't show anything, nothing in the logs - and my logs are working fine. The only indication was a lack of an error message but nothing redirecting.
Searching, I found only this
You only need to keep in mind that the new JSF 2.0 provided implicit
navigation doesn't scan for the presence of the file,...
Migrating from JSF 1.2 to JSF 2.0
I guess I expected a "404" type of error if the redirect page didn't exist. I told the server to display a page that doesn't exist, so some error must of raised and then discarded somewhere?
Is there some setting - maybe in web.xml - that will help display this type of coding error? Or anything else?
I just need it for dev.
PS. I did check the file name by copying it from the code and pasting it into the term but I made the mistake of using tab completion and of course it completed. If I had just put .xhtml on the end I would have seen the missing char.
if it helps, I'm running Tomcat 7

How to test an error page with Error 500 using Zend Framework

I am working on a project where client requires me to beautifully display error 500 with stacktrace etc.
So, I checked the Error Controller and made a nice fancy error page in corresponding views/script
The problem is, how do I test it?
Whilst working on the project, I cleared error on every page and there is no way I could generate it again. Also, I am using doctrine and I remember "echo-ing" the entitymanager array but, I cannot trace the location.
How would I custom generate error 500, "keeping it real"?
PS: I tried htaccess thing and trust me, it throws apache error and not zend 500.
It was pretty silly but, finally found it.
All I needed was to mis-spell a dql tablename on any page where I use querybuilder.

Zend Log: Unexplained Error On Page Request

I'm working on a very custom project using the Zend Framework, where the application uses database driven routes, default routes disabled by default, and a module setup.
I've just created a Zend_Log writer, that logs application errors in the Database.
The thing is, I've got two unexplained errors:
5 NOTICE M:\Zend_Framework\library\Zend\Controller\Action.php Line 516 Page not found
5 NOTICE M:\Zend_Framework\library\Zend\Controller\Action.php Line 516 Request Parameters
I've had a look at the line in question and it just has $this->$action();, which doesn't help me!
Can anyone tell me how I can debug this further?
These are not complete errors. Your logging is somehow broken. We did something like this for our project earlier - you can as well log get/post params, stacktrace, etc.
This looks like someone request nonexistent action - something like /index/does-not-exist

symfony/zend integration - blank screen

I need to use ZendAMF on a symfony project and I'm currently working on integrating the two.
I have a frontend app with two modules, one of which is 'gateway' - the AMF gateway. In my frontend app config, I have the following in the configure function:
// load symfony autoloading first
parent::initialize();
// Integrate Zend Framework
require_once('[MY PATH TO ZEND]\Loader.php');
spl_autoload_register(array('Zend_Loader', 'autoload'));
The executeIndex function my the gateway actions.class.php looks like this
// No Layout
$this->setLayout(false);
// Set MIME Type
$this->getResponse()->setContentType('application/x-amf; charset='.sfConfig::get('sf_charset'));
// Disable cause this is a non-html page
sfConfig::set('sf_web_debug', false);
// Create AMF Server
$server = new Zend_Amf_Server();
$server->setClass('MYCLASS');
echo $server->handle();
return sfView::NONE;
Now when I try to visit the url for the gateway module, or even the other module which was working perfectly fine until this attempt, I only see a blank screen, with not even the symfony dev bar loaded. Oddly enough, my symfony logs are not being updated as well, which suggests that Synfony is not even being 'reached'.
So presumably the error has something to do with Zend, but I have no idea how to figure out what the error could be. One thing I do know for sure is that this is not a file path error, because if I change the path in the following line (a part of frontendConfiguration as shown above), I get a Zend_Amf_Server not found error. So the path must be correct. Also if I comment out this very same line, the second module resumes to normality, and my gateway broadcasts a blank x-amf stream.
spl_autoload_register(array('Zend_Loader', 'autoload'));
Does anyone have any tips on how I could attach this problem?
Thanks
P.S. I'm currently running an older version of Zend, which is why I am using Zend_Loader instead of Zend_autoLoader (I think). But I've tried switching to the new lib, but the error still remains. So it's not a version problem as well.
got it...
I was not using
set_include_path()
while loading Zend. It's still odd that it would give such a cryptic error, but this was the missing piece indeed.