| Ammaletu |
|
NetHosted Customer

Joined: 27 Jul 2008 Posts: 6 Location: Cardiff, Wales
|
Posted: Thu Aug 14, 2008 8:12 am Post subject: php error log position |
| |
Hi!
Just a short question: How can I best manage the position of the PHP error log? I just tried it out by provoking a PHP error and it showed the error on the screen and wrote an error_log file in the same directory. I'd like to change that to not showing errors on the screen and writing to a log file in an error-logs directory outside of public_html.
I know I can do this with a php.ini file, but apparently I need to have a php.ini in every directory that contains PHP files. So before doing this, I thought I'd ask if there is an easier way to do this. Can it be done via a .htacess file for all sub-directories? I tried that too, but it failed with an error message (error 500), although that could just be me getting the syntax wrong. Any help on this is appreciated. :-)
Regards,
Johannes |
|
| Back to top |
|
| NetHosted - Andrew |
|
NetHosted Staff

Joined: 22 Mar 2004 Posts: 5651
|
Posted: Thu Aug 14, 2008 10:09 am Post subject: |
| |
Johannes,
Due to the way PHP is run on the server you are on the only way you can manipulate it is via php.ini files. I'm afraid you will need to place the php.ini into each directory.
Andrew _________________ | Andrew Bassett
| Managing Director, NetHosted Ltd.
| Resellers, take a look at overselling !
| Members, tell us what you think of NetHosted! |
|
| Back to top |
|
| Ammaletu |
|
NetHosted Customer

Joined: 27 Jul 2008 Posts: 6 Location: Cardiff, Wales
|
Posted: Sun Aug 17, 2008 9:42 pm Post subject: |
| |
Thanks for the answer, I'll use the php.ini files then. Although I think you could use better default settings. Displaying PHP errors on the screen on a production system is generally considered not good, and writing errors into a file in the directory where they occured strikes me as just unpractical. If an error happens and someone tells me that something's wrong on my site, I want to know where to look for it instead of searching through dozens or hundreds of directories. ;-) Shouldn't it be possible to set an error log location relative to each user's root directory in the default settings!? Just a thought...
Greetings,
Johannes |
|
| Back to top |
|
| NetHosted - Andrew |
|
NetHosted Staff

Joined: 22 Mar 2004 Posts: 5651
|
Posted: Sun Aug 17, 2008 11:08 pm Post subject: |
| |
Johannes,
Thanks for your feedback, we'll take these comments on board. It seems to me however that most users would be confused by not seeing any errors on screen when something wasn't working with their scripts.
Andrew _________________ | Andrew Bassett
| Managing Director, NetHosted Ltd.
| Resellers, take a look at overselling !
| Members, tell us what you think of NetHosted! |
|
| Back to top |
|
| petethegeek |
|
NetHosted Customer

Joined: 14 Feb 2005 Posts: 189 Location: Worcester
|
Posted: Mon Aug 18, 2008 4:02 pm Post subject: |
| |
I may well be missing something here, but assuming you have access to the scripts, and there aren't too many of them, is it not possible to use some combination of error_reporting , and ini_set along with the error_log and error_reporting directives to achieve what is required?
Regards,
Pete _________________ "I have made this letter long, only because I lacked the time to make it short." - Blaise Pascal 1657 |
|
| Back to top |
|
User Permissions |
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
| |