Msg#: 3468820 posted 10:33 am on Oct 4, 2007 (gmt 0)
I have a custom SQL error reporting function which I'm using to write errors to a file at the domain root.
To be exact, the site is running in a subdomain and I want to write the errors to a file in the subdomain route.
My problem is that if I use...
error_log($msg, 3, "/sql_remote_error_log.log")
when the script that causes the error is not in the root directory, eg. '/docs/bad_script.php' the error is written to the '/docs/' directory instead. I wouldn't mind but I have lots of directories and it's getting really tedious trying to check all the logs!
The error function is only referenced by the bad_script.php, I can't type the full path in my function because if I do it will be incorrect when accessed from other locations.
I also tried specifying an absolute path from 'http://..' but it failed with an error (something about http wrapper does not support writable connections.
Msg#: 3468820 posted 12:38 am on Oct 5, 2007 (gmt 0)
I've now tried fopen and unfortunately it failed too, with the following error message:
"Warning: fopen(http://mydomain.ph/sql_remote_error_log.log) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections. in /usr/home/mydomain/domains/mydomain.ph/public_html/functions/common_funcs.php on line 46 Cannot open error log."