Jump to content

Recommended Posts

I's like to check if my site is running without errors.

They are probably blinded out now, whilst it has been running for 1,5 year on 7.2 now.

What would I need to do to enable error-reporting (want to do this for just a short time)

Running Bootstrap Frozen (May '18) patched up to march this year.

My application_top.php starts like this:

<?php
/*
  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2014 osCommerce

  Released under the GNU General Public License
*/

// start the timer for the page parse time log
  define('PAGE_PARSE_START_TIME', microtime());

// set the level of error reporting
  error_reporting(E_ALL & ~E_NOTICE);
  
  if (defined('E_DEPRECATED')) {
    error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
  }

 

Share this post


Link to post
Share on other sites

do you really want to see everything?

comment out

 error_reporting(E_ALL & ~E_NOTICE);
  
  if (defined('E_DEPRECATED')) {
    error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
  }

with

/* error_reporting(E_ALL & ~E_NOTICE);
  
  if (defined('E_DEPRECATED')) {
    error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
  }*/
error_reporting(E_ALL);
ini_set('display_errors','1');

though this may still be overridden via the php.ini master setting


No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P


Support The Project
Documentation/Knowledgebase/Discussions
 

Share this post


Link to post
Share on other sites
Posted (edited)

@René H4 if it is just the deprecated stuff you want to be able to see then just comment out the deprecated part

 /* if (defined('E_DEPRECATED')) {
    error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
  }*/
ini_set('display_errors','1');

 

Edited by 241

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P


Support The Project
Documentation/Knowledgebase/Discussions
 

Share this post


Link to post
Share on other sites

If it's a live site, you might be better to use:

ini_set("log_errors", 1);
ini_set("error_log", __DIR__."/php-error.".date('ymd').".log");

instead of

ini_set('display_errors','1');

This will write all the errors to a log file - and create a new file every day if you forget to turn it off again, so it doesn't get too huge!


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

Sorry guys, but I am confused now. I indeed would like to log.

Is this the correct symtax?

// set the level of error reporting
  error_reporting(E_ALL & ~E_NOTICE);
  
/*  if (defined('E_DEPRECATED')) {
    error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
  }*/
ini_set("log_errors", 1);
ini_set("error_log", __DIR__."/php-error.".date('ymd').".log");

 

Share this post


Link to post
Share on other sites
Posted (edited)

I ask because my site stops working when I change to the above.....

The error message in the log is:

AH01071: Got error 'PHP message: PHP Parse error: syntax error, unexpected '??' (T_COALESCE), expecting end of file in /var/www/vhosts/myshop/httpdocs/includes/application_top.php on line 22\n', 

Edited by René H4

Share this post


Link to post
Share on other sites

@René H4 try

ini_set("error_log", "name_of_directory/php-error.".date('ymd').".log");

 


No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P


Support The Project
Documentation/Knowledgebase/Discussions
 

Share this post


Link to post
Share on other sites
Posted (edited)

@René H4 Did you copy and paste if so try just typing it as sometimes copy and paste introduces errors

 

Edited by 241

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P


Support The Project
Documentation/Knowledgebase/Discussions
 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×