Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

some error reporting questions

General discussions related to php

Moderators: macek, egami, gesf

some error reporting questions

Postby billygoatkaraoke » Wed May 30, 2012 8:03 am

Gidday

I have a VPS running both my live site and a totally separate password protected version of the site as a production one. Both have exclusive databases and domains.

I was wondering if setting error reporting in php.ini is global (so it affects both sites)?

I'd like to set it up so that select errors are logged to a file above root in the live site, but all warnings and errors are displayed on the production site.

Is this possible, or is error reporting global?

If it is possible, can I have one error reporting config setting somewhere for each site, or do I have to have code on every php page instructing what I want?

Cheers guys
billygoatkaraoke
New php-forum User
New php-forum User
 
Posts: 91
Joined: Sat Aug 13, 2011 7:20 pm

Re: some error reporting questions

Postby Nullsig » Wed May 30, 2012 8:27 am

It is global. You can enable the error reporting on the selected site by using the "ini_set" command through.
User avatar
Nullsig
php-forum Fan User
php-forum Fan User
 
Posts: 981
Joined: Thu Feb 17, 2011 6:52 am
Location: Racine, WI

Re: some error reporting questions

Postby Emy » Sat Jun 02, 2012 8:48 pm

set display_errors to off in your pho.ini, then if you want to see the errors of each site juste add it on each page:

http://php.net/manual/en/function.error-reporting.php
Emy
New php-forum User
New php-forum User
 
Posts: 16
Joined: Sat Jun 02, 2012 8:16 pm

Re: some error reporting questions

Postby billygoatkaraoke » Mon Jun 04, 2012 2:44 am

Ahh - thanks guys. I like the idea of turning it off globally and then on per page when I need it.
billygoatkaraoke
New php-forum User
New php-forum User
 
Posts: 91
Joined: Sat Aug 13, 2011 7:20 pm

Re: some error reporting questions

Postby billygoatkaraoke » Wed Jun 13, 2012 7:01 pm

Just wanted to confirm that the error_reporting() functions only turn it on for the site the script is on, and not globally for the server (I'm assuming ini_set('error_reporting', E_ALL); would set it globally)?
billygoatkaraoke
New php-forum User
New php-forum User
 
Posts: 91
Joined: Sat Aug 13, 2011 7:20 pm


Return to PHP General

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.