Forum Moderators: coopster

Message Too Old, No Replies

PHP Blank Pages

         

mikeFromEngland

3:16 pm on Feb 5, 2008 (gmt 0)

10+ Year Member



I have a PHP website up and running on my local apache server using PHP version 4.2.3. All works fine.

However, I have uploaded it to the web server and the PHP pages either return a blank page (Internet Explorer) or a page detailing the actual PHP code (Mozilla). I've been googling this for a week or two now and all ideas point to modifiying the httpd.conf file on the server. Mine all looks fine but I still can't get PHP to work properley on the server.

Any tips would be hugely appreciated.

Thanks

Mike

eelixduppy

3:23 pm on Feb 5, 2008 (gmt 0)



Welcome to WebmasterWorld!

you might want to take a look at this thread explaining how to install php onto your webserver: [webmasterworld.com...]

You can skip all of extra information in there about installing other components and just focus on the php aspect. That should get you along the way. If it's the case where you already have php installed, then there is a problem with the installation and you should check all of the steps listed in the thread linked to above to see if anything was missed.

And as a general note, when you make changes to your server's configuration files don't forget to restart apache so that the changes can take affect.

maxximus

4:41 pm on Feb 5, 2008 (gmt 0)

10+ Year Member



Could be various Apache/ PHP settings.

Are you running your scripts with short tags ie

<? // your php code here?>

Might need to turn on short tags.

You will need to look at your remote server setting.

<?php phpinfo()?>

Edited for clarity

[edited by: maxximus at 4:53 pm (utc) on Feb. 5, 2008]

mikeFromEngland

4:50 pm on Feb 5, 2008 (gmt 0)

10+ Year Member



Hi all,

phpinfo returns either blank page or page showing php depending on browser.

The LoadModules line is there in the conf file - what else may I need to add?

Thanks for any further help.

Cheers

web master genius

2:10 pm on Feb 6, 2008 (gmt 0)

10+ Year Member



if internet explorer receives <?php tags, it won't show it, but in mozilla i think it shows. The browsers are receiving <?php or <? tags because PHP is not interpreting the code. If PHP installed on the server (as you said) Is it configured in apache/iis? Check with your web master, or if you own the server, check apache or iis. P.S. you should need to configure httpd.config if you hadn't as your searches said. :-)

mikeFromEngland

2:20 pm on Feb 6, 2008 (gmt 0)

10+ Year Member



hI web master genius.

We own the server and as far as I can see, the httpd.conf is configured correctly. From advice that other have given, I need to esnure the following lines are in place:

LoadModule php_module modules/mod_php.so
LoadModule php3_module modules/libphp3.so
LoadModule php4_module modules/libphp4.so

AddModule mod_php.c
AddModule mod_php3.c

AddType application/x-httpd-php .php4
AddType application/x-httpd-php .php

These were initailly commented out. I've uncommented them, restarted the server but still the problem persists. This is very starnge as I have all pages working fine on my own local Apache / PHP installation and the httpd.conf.

Again, thanks for tips and advice and anything else you can offer would be hugely appreciated.

Many thanks

Mike