Comment 5 for bug 135624

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Attached is an updated lamp-test.php. Per Soren Hansen's recommendations, I changed the mysql_connect() call to have no arguments and use extension_loaded() instead of register_shutdown_function().

I also made the PHP comment in the raw HTML more clear. I considered using something like this:
 <td>PHP</td><td><!-- <?php print("-->Works<!--"); ?> --></td>

but decided against it for several reasons. It doesn't do what is intended. While it works fine if PHP is installed and operating correctly, if PHP is disabled and the page happens to be rendered as HTML (a non-default apache configuration), then the user sees 'PHP Works', as the HTML comments just comment out the php parts. Also if PHP is disabled and the page is sent as raw text for download as lamp-test.php (which is what apache does when it doesn't recognize the mime type), then when the user reads the page, the above code snippet may not be clear (and may even make the user think it did 'work', if they don't understand the code).

As such, I just made the message clearer:
      If you were prompted to download this page as lamtp-test.php and/or
      are viewing this as raw HTML in your browser, then php is not properly installed.

      To install, do (as root):
      apt-get install libapache2-mod-php5
      a2enmod php5
      /etc/init.d/apache2 force-reload