Lubuntu cont’d — add PHP

I’m following the directions on the page called ApacheMySQLPHP in the section called Installing PHP 5.

Why I Copy other People’s Writings

Installing the Package

Use any method to install the package

libapache2-mod-php5

Enable this module by doing

sudo a2enmod php5

which creates a symbolic link /etc/apache2/mods-enabled/php5 pointing to /etc/apache2/mods-availble/php5 .

The installer hints that php.ini for apache2 is here:

/etc/php5/apache2/php.ini

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(); ?>

Load 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.

Next Post

Lubuntu cont’d – add MySQL

Advertisements

About samehramzylabib

See About on https://samehramzylabib.wordpress.com
This entry was posted in Configure My Systems. Bookmark the permalink.

One Response to Lubuntu cont’d — add PHP

  1. Pingback: Lubuntu cont’d — Actual Apache2 Configuration | Sam's PHP How-To

Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s