I don’t want PHP errors to display /html, but I want them to display in /html/beta/usercomponent. Everything is set up so that errors do not display at all. How can I get errors to just show up in that one folder (and its subfolders)?
I don’t want PHP errors to display /html, but I want them to display
Share
In
.htaccess:This number, according to documentation should enable ‘all’ errors irrespective of version, if you want a more granular setting, manually OR the values together, or run
to let php compute the value for you.
You need
in apaches master configuration to enable .htaccess files.
More Reading on this can be found here:
Notice If you are using Php-CGI instead of mod_php, this may not work as advertised, and all you will get is an internal server error, and you will be left without much option other than enabling it either site-wide on a per-script basis with
or similar constructs before the error occurs.
My advice is to disable displaying errors to the user, and utilize heavily php’s error_log feature.
If you have problems with this being too noisy, this is not a sign you need to just take error reporting off selectively, this is a sign somebody should fix the code.
@Roger
Yes, you can use it in a
<Directory> construct in apaches configuration too, however, the .htaccess in this case is equivalent, and makes it more portable especially if you have multiple working checkout copies of the same codebase and you want to distribute this change to all of them.If you have multiple virtual hosts, you’ll want the construct in the respective virtual hosts definition, otherwise, yes
The Additional ‘ifmodule’ commands are just a safety net so the above problem with apache dying if you don’t have mod_php won’t occur.