Re: Writing out errors to a file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 3, 2011 at 19:55, Rick Dwyer <rpdwyer@xxxxxxxxxxxxx> wrote:
> Hello all.
> How do I get PHP to write out any errors or warnings to a text file that I
> can review and go through to troubleshoot issues?
> I don't have access to the ini file... so I was hoping for a simple write to
> a file at the web root.

    (NOTE: This reply presumes you're using *NIX or similar, with
hints to Apache.  You may need to make some adjustments.)

    Others gave you some great suggestions, but here's another tip:
you *do* have access to the ini file.  You just need to copy it into
your local folder and then you can modify it to your heart's content
(at long as your heart doesn't desire changing PHP_INI_SYSTEM values).
 See here:

        http://php.net/manual/en/ini.list.php

    So, for example, if your host maintains the php.ini file in
/etc/php.ini, simply copy it from there to your home directory.  You
will have privileges to read the file on the system, and your local
copy will then be owned by you, not the original owner, permitting its
modification.  Then, any allowable changes you make in the file will
be reflected in your site and all of its subfolders --- no need to
restart Apache.

    Don't want to have changes affect all of the subdirectories?  Just
move your local php.ini to the directory you want to be affected by
the change.  Wherever you place the file in your site structure, it
will affect that and all child directories.  So the home and
public_html (or www, et cetera) directories will affect the entire
site, while ~/public_html/admin/php.ini will have an effect on
~public_html/admin, ~public_html/admin/includes,
~public_html/admin/.private, and the like, but will *not* interfere
with ~/public_html, ~/public_html/customers, and so forth.  You can
have just one to tweak your site settings, or one in each and every
directory with different settings (which would be a nightmare, but
it's still possible).

-- 
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux