vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Problems seeing error messages (https://vborg.vbsupport.ru/showthread.php?t=102191)

KevinM 12-04-2005 07:05 AM

Problems seeing error messages
 
It's been a while since I have done anything in PHP, and I thought it's time to start upgrading my custom scripts on my forum to work with 3.5.1.

My problem is that the PHP errors are not being outputed to the screen, so debugging my own scripts is difficult. (I just get blank screen).

I have the 'error_reporting(E_ALL & ~E_NOTICE);' at the top of the page and the only vb page included is global.php.

I don't remember having this when I was working on 3.0 (but I might be wrong / or perhaps i didn't make any coding errors ;) ).

What do I need to do to see the php errors?

Marco van Herwaarden 12-04-2005 07:13 AM

You should always see PHP errors. Could you be a bit more specific?

KevinM 12-04-2005 07:39 AM

This is part of a custom script I used in 3.0 and am now upgrading to 3.5.

What I mean by not showing errors, is that if I make a typo (e.g. leave off a ';') I still don't get an error message, just a blank screen.

Any ideas?


PHP Code:

<?php 

// ####################### SET PHP ENVIRONMENT ########################### 
error_reporting(E_ALL & ~E_NOTICE); 

// #################### DEFINE IMPORTANT CONSTANTS ####################### 
define('NO_REGISTER_GLOBALS'1); 
define('THIS_SCRIPT''view_headers');

// ################### PRE-CACHE TEMPLATES AND DATA ###################### 
// get special phrase groups 
$phrasegroups = array(

); 

// get special data templates from the datastore 
$specialtemplates = array( 
     
); 

// pre-cache templates used by all actions 
$globaltemplates = array( 
    
'viewheaders''viewheaders2'
); 

// pre-cache templates used by specific actions 
$actiontemplates = array( 

); 

// ######################### REQUIRE BACK-END ############################ 
require_once('./global.php'); 

// ####################################################################### 
// ######################## START MAIN SCRIPT ############################ 
// ####################################################################### 

$navbits = array(); 
$navbits[$parent] = 'View Message Headers'

// make sure we keep the post number
$postheaders $_GET['p'];
                    
// and the thread
$threadneeded $_GET['t'];


if (
$postheaders){

$get_headers=$db->query("SELECT * FROM " TABLE_PREFIX "post WHERE postid = " $postheaders "");
$get_headers=$db->fetch_array($get_headers);
                }
                
    if (!
$get_headers["headers"])
        { 
        
$get_headers["headers"] = "No headers were kept for this post. Headers were only archived after October 2005 for posts originating from outside of this forum.";
        }
$get_headers["headers"] = str_replace("<""?"$get_headers["headers"]);
$get_headers["headers"] = str_replace(">""?"$get_headers["headers"]);
$get_headers["headers"] = htmlspecialchars($get_headers["headers"]);
$get_headers["headers"] = str_replace(":: "": </div></strong></td><td class=\"alt1\">",$get_headers["headers"]);
$get_headers["headers"] = str_replace("\r\n""</td></tr><tr><td valign=\"top\" class=\"alt1\"><strong><div align=\"right\">",$get_headers["headers"]);
            } else     {
                    
$headerserror "An error occurred, no post specified";
                    }
// display headers
$navbits construct_navbits($navbits); 
eval(
'$navbar = "' fetch_template('navbar') . '";'); 
eval(
'print_output("' fetch_template('viewheaders2') . '");');         
            
                            }
?>


Marco van Herwaarden 12-04-2005 08:05 AM

I don't see why you shouldn't be getting PHP errors.

KevinM 12-04-2005 11:02 AM

Ok, I think it must be a php configuration problem.


All times are GMT. The time now is 08:46 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01175 seconds
  • Memory Usage 1,741KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete