logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> How-to's & Documentation & Tips View previous topic :: View next topic
Reply to topic   Topic: Basic PHP Troubleshooting
Author
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3049
Location: Hilversum, NL, EU

PostPosted: Sat 12 Apr '08 17:34    Post subject: Basic PHP Troubleshooting Reply with quote

Basic PHP Troubleshooting:

►When Apache IS NOT processing PHP script, you will usually get a dialog box asking to save the file or which application to use to open. This is usually caused by a missing or inappropriate handler (i.e. - php5apache2_2.dll).

►Another problem is that people many times use OLD PHP script that uses 'short tags'. That is when the PHP declarative starts with <?. Since at least PHP 4, the default for opening PHP script has been <?php. If you are using script with short tags, then you can do one of two things. Either change ALL of your opening tags to <?php, or edit you PHP.INI file changing short_open_tag to ON.

►The 'blank page' behavior is caused an error in your PHP script. The reason for the blank page is because display_errors directive is set to OFF by default. If you set display_errors to ON errors will be displayed in the browser. However, it is not considered safe to do so except on well tested code since certain things can be revealed that you might no want revealed. I suggest setting the ERRORS section of the PHP.INI to something similar to this:

log_errors = On

error_log = "C:/php5/error.log"

Everything else set to defaults. You will still get a blank page, but when you do you can open the error log to see what happened.

►When the script is being displayed in the browser instead of actually processing the script, this is usually caused by the PHP file not having a PHP extension. Example:

phpfile.html

or

phpfile.php.txt

or

phpfile.txt

PHP files should have .php as the extension. Such as phpfile.php


Back to top
jasonflord25



Joined: 30 Jul 2010
Posts: 1
Location: California

PostPosted: Fri 30 Jul '10 2:10    Post subject: Reply with quote

I just would like to say thank you for this cause this really help me a lot .
Back to top


Reply to topic   Topic: Basic PHP Troubleshooting View previous topic :: View next topic
Post new topic   Forum Index -> How-to's & Documentation & Tips