Ubuntu 16.04
Sponsored Link

Use PHP Scripts2016/05/10

 
Configure Apache2 to use PHP scripts.
[1] Install PHP.
root@www:~#
apt-get -y install php php-cgi libapache2-mod-php php-common php-pear php-mbstring
[2] Configure Apache2.
root@www:~#
a2enconf php7.0-cgi

Enabling conf php7.0-cgi.
To activate the new configuration, you need to run:
  service apache2 reload

root@www:~#
vi /etc/php/7.0/apache2/php.ini
# line 912: uncomment and add your timezone

date.timezone =
"Asia/Tokyo"
root@www:~#
systemctl restart apache2

[3] Create a PHP test page and access to it from any clients with web browser. It's OK if following page is shown.
root@www:~#
vi /var/www/html/index.php
<html>
<body>
<div style="width: 100%; font-size: 40px; font-weight: bold; text-align:center;">
<?php
      print Date("Y/m/d");
?>
</div>
</body>
</html>
Matched Content