Linux – Apache Part 3: PHP

Enabling PHP for Apache server is trivial.

apt-get install php5 libapache2-mod-php5
service apache2 restart

Lets check if PHP really works:

#in main directory for you page create file
vim /var/www/example.com/public_html/info.php

<?php
phpinfo();
?>

Use browser to check your info.php to confirm that php is up and running on your apache server.

 

You can always go back to check those steps:

You can always go back and check those posts:

Linux – Apache Part 1: Instalation and configuration

Linux – Apache Part 2: Enable SSL

Or go forward:

Linux – Apache Part 4: MySQL and MariaDB Database

Leave a Reply

Your email address will not be published.

*