Zendcasts Forum

A community of developers who work with the Zend Framework and other enterprise PHP technologies

You are not logged in.

#1 2010-06-04 03:53:53

beregu
Member
From: Mongolia
Registered: 2009-10-27
Posts: 12

How to make standard PHP exception beautiful?

Hello Jon,

Could you tell us how we can make standard php exception handler similar to yours, Jon? In your videos, your php exceptions looks very cool.. Everything wrapped into lines, but mine is printed just inline. Very hard to find the actual error msg, lines and etc..


Thanks ;)

Offline

#2 2010-06-04 04:21:40

beregu
Member
From: Mongolia
Registered: 2009-10-27
Posts: 12

Re: How to make standard PHP exception beautiful?

Wow... I just found very simple solution.

In PHP.ini, just uncomment error_prepend_string, error_append_string and change the current html tag to <PRE></PRE>.

It will look like:
error_prepend_string = "<pre>"
error_append_string = "</pre>"

Now, I need to wrap it and give a little color.

Offline

#3 2010-06-04 04:26:44

beregu
Member
From: Mongolia
Registered: 2009-10-27
Posts: 12

Re: How to make standard PHP exception beautiful?

Just made it a little bit better:

error_prepend_string = "<pre style='white-space: pre-wrap;white-space: -moz-pre-wrap;white-space: -pre-wrap;white-space: -o-pre-wrap;word-wrap: break-word;font-size: 12px; font-family:Arial'>"

Now, fatal error looks much much better...

If Jon shares his decorators, mmm.....

Last edited by beregu (2010-06-14 16:38:50)

Offline

#4 2010-06-06 19:54:47

tawfekov
Administrator
From: www
Registered: 2009-08-06
Posts: 25
Website

Re: How to make standard PHP exception beautiful?

hey beregu ,
If you mean like this image
error_message.jpg
so you should learn more about Xdebug check out this article
http://devzone.zend.com/article/2803

Offline

#5 2010-06-07 03:32:16

beregu
Member
From: Mongolia
Registered: 2009-10-27
Posts: 12

Re: How to make standard PHP exception beautiful?

Thanks tawfekov. That's exactly what I needed..

Last edited by beregu (2010-06-14 16:39:15)

Offline

#6 2010-06-11 16:21:44

jamesturner125
New member
Registered: 2010-05-24
Posts: 1

Re: How to make standard PHP exception beautiful?

And I've been searching for this info for days!! Thanks for sharing! nz pokies

Offline

#7 2010-06-15 00:55:09

Jon Lebensold
Administrator
Registered: 2009-06-27
Posts: 279

Re: How to make standard PHP exception beautiful?

You can take it a step further too!

http://www.iezzi.ch/archives/397

Offline

#8 2010-11-27 00:57:45

sone
New member
Registered: 2010-11-19
Posts: 3

Re: How to make standard PHP exception beautiful?

Hey I've tried the method at http://www.iezzi.ch/archives/397

"All you need is an ErrorController and the modified shiny.phtml view script. You can grab both from our Subversion repository"


Replaced my ErrorController and added the shiny.phtml to my views/scripts/errors folder but still no change. Is there something else missing?

Offline

#9 2010-11-27 16:26:22

vengiss
New member
Registered: 2010-08-19
Posts: 9

Re: How to make standard PHP exception beautiful?

I think you also need to add:

resources.frontController.errorview = shiny

To your config file.

Offline

#10 2010-11-28 10:03:45

sone
New member
Registered: 2010-11-19
Posts: 3

Re: How to make standard PHP exception beautiful?

Yeah that did the trick thanks so much!

Offline

Board footer

Powered by FluxBB