What Happened If Your PHP Not Showing?

If PHP was not enabled, your .php file will be treated as .html file. So, <?php…> will be treated as html tag, which would not show at all. More tricky is, if your codes include ->, the first > will be treated as the end tag for <?php…>. This would confuse you because you would think the first -> has been mistakenly regarded as ?>.

Here are solutions. First, save as following piece of codes as phpinfo.php:

<?php
phpinfo();
?>

Then call it in your browser. It will list all of the configuration information about php. If it shows a blank page, it means your php has not been enabled.

If you are in personal server, run following scripts:

LoadModule php5_module "/path/to/php5apache2_2.dll" #use php5apache2.dll for apache 2.x, use php5apache.dll for apache1.x

AddType application/x-httpd-php .php

If you are in shared server, contact administrator.

The another possibility is your server does not recognize your php codes if they were composited by text editor such as Notepad, which indeed still have some uncleared characters. To overcome this, find a pure cleaning php code editor, such as Crimson Editor, copy to it and save as new .php file.

No comments:

Post a Comment

Labels