[SOLVED]include/require bombs the app
Posted: Thu Feb 17, 2011 12:14 pm
In my application, I've got a number of include statements and they all seem to be working, save one. Or, rather, include statements that include a particular class file.
I have the following test file (as I wanted to see if it was something to do with the original file):
I hit a breakpoint at my include statement in this file:
And it gets me to here:
And there's a breakpoint at the same point in DBConnection.php that never gets hit.
I'm really new to PHP and how all this works in PHP, so I'm lost as to what it is about the include_once that causes this thing to die an ugly (and undocumented) death. There's nothing coming back to the console that helps me out. Just that the script terminated. The behavior I get from the browser is that it pops up a couple of dialogs offering me the options to Find, Save or Cancel the page.
I have the following test file (as I wanted to see if it was something to do with the original file):
Code: Select all
<?php session_start();?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
</head>
<body>
<?php
include '../classes/Input.php';
$select = new Input();
$valCol = "cityid";
$labelCol = "cityname";
$tableName = "cities";
$andArray = array();
$orArray = array();
$sortOrder = "sort_order";
$name = "city";
$select->getSelect($valCol, $labelCol, $tableName, $andArray, $orArray, $sortOrder, $name);
echo $select;
if(isset($_SESSION['errorMsg'])){
echo "Error: ".$_SESSION['errorMsg'];
unset($_SESSION['errorMsg']);
}
?>
</body>
</html>
Code: Select all
<?php session_start();?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
</head>
<body>
<?php
include '../classes/Input.php'; // <<<<<<<<<<<< BREAKPOINT SET HERE
$select = new Input();
$valCol = "cityid";
$labelCol = "cityname";
$tableName = "cities";
$andArray = array();
$orArray = array();
$sortOrder = "sort_order";
$name = "city";
$select->getSelect($valCol, $labelCol, $tableName, $andArray, $orArray, $sortOrder, $name);
echo $select;
if(isset($_SESSION['errorMsg'])){
echo "Error: ".$_SESSION['errorMsg'];
unset($_SESSION['errorMsg']);
}
?>
</body>
</html>
Code: Select all
<?php
include_once 'DBConnection.php';// <<<<<<<<<<<<<<<<BREAKPOINT SET HERE
I'm really new to PHP and how all this works in PHP, so I'm lost as to what it is about the include_once that causes this thing to die an ugly (and undocumented) death. There's nothing coming back to the console that helps me out. Just that the script terminated. The behavior I get from the browser is that it pops up a couple of dialogs offering me the options to Find, Save or Cancel the page.