How to get your own PHP error log via .htaccess

How to get your own PHP error log via .htaccess

I would like to get my own PHP error log, how can I do this?

===========================================



If you don't have a .htaccess file, create it it using the file manager
or a regular text editor on your computer and upload that file using
ftp. Just make sure that the file name on the server is .htaccess. If
you already have an .htaccess file, then add the directives below to
that file.





First you'll want to hide PHP errors from visitors by adding this to your .htaccess:



# supress php errors

php_flag display_startup_errors off

php_flag display_errors off

php_flag html_errors off



With that in place, PHP errors will no longer be displayed publicly on your site. It hides the e

Add the following directive to a .htaccess file.



Next, enable private PHP error log by adding the following to your .htaccess:



# enable PHP error logging

php_value error_reporting 30719

php_flag log_errors on

php_value error_log /hsphere/local/home/YOUR_USER_HERE/php_error.log





Ensure that the path matches your home directory path. You can find it in your control panel under FTP User.



Next, create the php_error.log and make sure to give it world writing
(change permissions to 777 for the file name php_error.log). As this
file is out side the web directory file and not an executeable file, it
is relatively safe to do so.
    • Related Articles

    • Changing PHP Memory Limit via .htaccess

      If you get an error such as: Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 317560 bytes) On your PHP scripts, you can fix it with a line in your .htaccess reading: php_value memory_limit 12M Simply modify the 12M to ...
    • PHP session.save_path error

      You receive the following error in PHP: "The session.save_path setting in your php configuration file (php.ini) is not set or is set to a folder which did not exist. You might need to set the save_path setting in php.ini or verify that the folder ...
    • .htaccess

      .htaccess     Example of URI Redirects in a WP Site: [root@ca-web1 aiglebleu.org]# cat .htaccess # Redirects <IfModule mod_rewrite.c> RewriteCond %{REQUEST_URI} (entag/)(.*) RewriteRule ^(.*)entag/(.*)$ http://www.aiglebleu.org/en/$2 [NC,L] ...
    • cPanel Module - "unable to get cpanel security token" Error

      The Bacula4Hosts cPanel module explicitly requires cpanel security tokens to be enabled in order to operate. http://docs.cpanel.n...ecurityConcepts If you are using the cPanel module and receive an error as follows: "unable to get cpanel security ...
    • PHP

      Php     Sort PHP processes by user: Show PHP Errors: put this code at top of php page you want to test (usually index.php): error_reporting(E_ALL); ini_set('display_errors', 1);