I’m following the directions on the page called ApacheMySQLPHP in the section called Installing PHP 5.
Installing the Package
Use any method to install the package
Enable this module by doing
sudo a2enmod php5
which creates a symbolic link
/etc/apache2/mods-enabled/php5 pointing to
The installer hints that
apache2 is here:
Turn off short open tag
Except if you use deprecated PHP code beginning only by “<?” instead of “<?php” (which is highly inadvisable), open, as
root, the file
/etc/php5/apache2/php.ini , look for the line “short_open_tag = On”, change it to “short_open_tag = Off” (not including the quotation marks) and add a line of comment (beginning by a semi-colon) giving the reason, the author and the date of this change.
Relaunch Apache 2 by
sudo service apache2 restart
Test the Installation
Create the file
/var/www/test.php — having the line
<?php phpinfo(); ?>
http://localhost/test.php in browser. If you see the PHP information page then you have succeeded.
More php.ini stuff
As with my iMac setup I want to make some
php.ini modifications compatible with having a development environment. This is something I can keep revisiting.
Most of the changes I’ve made to
php.ini relate to how the development environment differs from a production environment. I won’t list those changes here because the
php.ini file does a good job of documenting how to choose those values. Just keep in mind that Lubunto installation handles some of the configuration which I did manually on the iMac—particularly as it relates to MySQL.
Firstly, I’ll backup the original
php.ini . Then I’ll set the following:
error_reporting = E_ALL | E_STRICT display_errors = On display_startup_errors = On date.timezone = "America/New_York"
Restart the web server.