Skip to content
Martin Vanbrabant edited this page Jan 17, 2019 · 1 revision

PHP

Installation

Note: done after installation of apache2.

Note: default php version is 7.0 in our case.

Install the basics:

# apt-get install php libapache2-mod-php

Install additional packages we'll need anyway:

(needed for the OpenID Connect PHP client demo)
# apt-get install php-curl
# apt-get install php-json
# apt-get install php-xml
# apt-get install composer
# apt-get install php-zip

Restart apache

# service apache2 restart

Configuration

For PHP used from within Apache2, the configuration file is /etc/php/7.0/apache2/php.ini.

Copy the original file to /etc/php/7.0/apache2/php.ini.dist.

Modify the original file as needed to develop.

Keep a copy of it as /etc/php/7.0/apache2/php.ini.dev.

Example diff /etc/php/7.0/apache2/php.ini.dev /etc/php/7.0/apache2/php.ini.dist:

445c445
< error_reporting = E_ALL
---
> error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
462c462
< display_errors = On
---
> display_errors = Off
517c517
< track_errors = On
---
> track_errors = Off

After modifying, restart Apache2.

# service apache2 restart

Clone this wiki locally