Jump to content

What am I doing wrong? Not getting errors in log


ballhogjoni
Go to solution Solved by Jacques1,

Recommended Posts

I'm trying to output errors to my log but it's not working. My apache config is as follows:

<VirtualHost *:80>
     ServerName domain.com
     ServerAlias www.domain.us
     DocumentRoot /var/www/html/domain
     <Directory /var/www/html/domain>
         Options +Indexes +FollowSymLinks +ExecCGI
         DirectoryIndex index.php
         AllowOverride All
         Order allow,deny
         Allow from all
     </Directory>
    ErrorLog /var/log/domain_error_log
</VirtualHost>

At the top of my script I have:

error_reporting(E_ALL);
ini_set('display_errors', 1);

I don't want errors on globally so my php.ini errors is set to off. When I go to the script in the browser I get a blank screen with no output to /var/log/domain_error_log. I feel I am missing something but don't know what it is.

Link to comment
Share on other sites

The Errorlog statement in the VirtualHost block records web server errors.

 

In the script, try adding:

ini_set('log_errors', true);
ini_set('error_log', "phpError.log");

If the script crashes before PHP has a chance to set those settings, also try to add the equivalent statements in the .htaccess file.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.