php displays blank in browser

5 posts by 3 authors in: Forums > CMS Builder
Last Post: June 18, 2009   (RSS)

Re: [LaKinns] php displays blank in browser

By Dave - November 17, 2008

Hi LaKinns, welcome to the CMS Builder forum! :)

There's a few things you can try. First, try viewing source. Sometimes a stray tag can cause the output to appear blank even if there's lots of content there.

Next, some web hosts are configured to not show any php errors. Try adding this code (in red) above step 1 to turn on error reporting:

<?php


// show all errors
if (!defined('E_STRICT')) { define('E_STRICT', 2048); } // define E_STRICT for PHP < 5
error_reporting(E_ALL | E_STRICT); // display all errors
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');


And if none of that works feel free to email me CMS and FTP login details to dave@interactivetools.com and I can take a look for you. (Note: email, don't post login details to the forum).

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] php displays blank in browser

By erinm356 - June 17, 2009

Hi Dave,

I'm having a problem too with php displaying blank in the browser. This is directly related to the fact that I moved the site from one directory to another. I have copied the text to generate errors into the php page and am now getting this:

Warning: require_once(D:/A10 Websites/www.soldiersandsailorsmuseum.org/cmsAdmin/lib/viewer_functions.php) [[url "http://www.soldiersandsailorshall.org/function.require-once"]function.require-once[/#0000ff][/url]]: failed to open stream: No such file or directory in D:\A10 Websites\www.soldiersandsailorshall.org\veteran-registry-list.php on line 12

The problem is that it's looking for the viewer_functions.php at the old location. I've updated everything in CMS admin, but that didn't resolve this error. Do you know what I need to update to get it to look for viewer_functions.php in the new location?

Thanks, Erin

Re: [erinm356] php displays blank in browser

By Dave - June 17, 2009

Hi Erin,

Yes, just change this line in all your viewer files:
require_once "D:/A10 Websites/www.soldiersandsailorsmuseum.org/cmsAdmin/lib/viewer_functions.php";

And update the part in red to have the path to your new directory.

Also, if you want to make it more portable and you know where your viewers will be in relation to the cmsAdmin dir you can make it simpler:

If all your viewers are in the root of your website you can just use this:
require_once "cmsAdmin/lib/viewer_functions.php";

And if they are in subfolder of your root you can do this:
require_once "../cmsAdmin/lib/viewer_functions.php";

And then moving dirs in future won't break it.

Hope that helps, let me know if the makes sense and works for you! :)
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] php displays blank in browser

By erinm356 - June 18, 2009

Thank you, Dave! That was exactly what I needed. It's working perfectly now.