Got a question?  Ask a developer in our Developer's Corner Forum

Back To The Developer's Corner Main Page

Find a PHP Error Using Print and Exit

If you can't get PHP to log an error for you using our PHP logging script, another technique to try is to walk through the PHP code adding print and exit statements until you find the line in the code where the error is occurring.

 

If you modify the index.php file in your Joomla root directory to add the following print/exit statement, you should see the "We made it here" message when you reload your page in your browser:

<?php

print "We made it here"; exit;

/**
* @version        $Id: index.php 11407 2009-01-09 17:23:42Z willebil $
* @package        Joomla
* @copyright    Copyright (C) 2005 - 2009 Open Source Matters. All rights reserved.

 

This will confirm that your index.php file is being executed properly and that the issue isn't with .htaccess or some other Apache configuration.

 

The next step is to move the print/exit statements down in your file until you don't see the "We made it here" message:

print "We made it here"; exit;
// Set flag that this is a parent file
define( '_JEXEC', 1 );

 

Then move here:

// Set flag that this is a parent file
define( '_JEXEC', 1 );

print "We made it here"; exit;

 

And so on.  This will help you find the line in index.php that is causing the issue or eliminate index.php as the cause of the problem.

 

 

 

Part of the SourceCoast Network:

SourceCoast / Cooking Allergy Free / CMS Market

© 2010 CMS Market. All rights reserved.

Joomla Facebook integration by JFBConnect

GTranslate Joomla Module