PDA

View Full Version : php pages just display a blank screen



owen100
09-30-2004, 04:37 AM
I've used/installed php scripts for a while but new to westhost.

I've just installed my first php script at

www.canaryplaces.com/choices

I ran the install and all went well, connected to the database fine and all the tables are there.

When I go to any the choices/index.php or any other main php file just get a blank page, what am I doing wrong? I have the basepath set as '/var/www/html/choices'; databse is fine.

wildjokerdesign
09-30-2004, 08:15 AM
It is hard to say without more infromation. Is Mod_php installed under Site Apps > Development? There is a link beside it once installed that you can hit that gives you a test page for php.

In the script that you are using you can turn on longing by inserting this at the start of the script.
ini_set("error_log", "/php_error_log");
ini_set("log_errors", 1);

I have it set here to place the log in your root directory but you could point it any place you wanted and even call the log anything you wanted.

Normally a blank screen means there is something wrong with the script like it can't find an include or you have forgot a ; at the end of a line.

owen100
09-30-2004, 08:48 AM
Thanks for the reply - yes I have the mod_php installed.

I added the logging code and the error is



[30-Sep-2004 08:41:41] PHP Fatal error: Call to undefined function: renderfeaturedlistingsvertical() in /var/www/html/choices/index.php on line 14


Line 14 of my script is

<?php renderFeaturedListingsVertical(4); ?>

I have this script up and running fine on another host and installed it first time, no problem. I followed exactly the same procedure to install it here. I've obviously got a setting wrong somewhere.

MySQL database and table looks fine so I'm baffled.

I'm off meanwhile to try installing another php scripts but this one not working is the main part of my site.

grim
09-30-2004, 10:04 AM
Make sure when you call include for the file that contains that function you have the path correct. It's likely to have changed from one host to another.

wildjokerdesign
09-30-2004, 12:44 PM
grim is right you need to check that the include is set right.

The error means that it can not find the "renderFeaturedListingsVertical" function. Look at the index.php file and see what files it is trying to include and that they are on the server. Not sure how the script is set up but you can change the include to the full path to test things. Here is an example of what I mean.


include($script_root_path . 'somefile.php');


In the above the $script_root_path is set by either a configuration file or another part of the script. If I knew that for sure that that somefile.php is located here "/var/www/html/scriptfiles/somefile.php" I could change the code to this:


include('/var/www/html/scriptfiles/somefile.php');

owen100
10-01-2004, 05:14 PM
Thanks!!!

Changed the include path and got it working fine now :)

ms425
10-08-2004, 03:59 PM
I'm having the same trouble. So what you are saying is change it to a site path rather than a document path?

wildjokerdesign
10-08-2004, 04:31 PM
It means that you put an absolute path in from root. If the file is located in your public web directory then the preface for anything is going to be /var/www/htm/ after that add the path from there. So if you are trying to include a file called "file.txt" that is located in a directory called "files" the path would look like this.
/var/www/html/files/file.txt