To check if php is installed you can check the version of it, for this you can use the linux terminal with the command:
php -v
This will return something like:
PHP 5.6.26-0+deb8u1 (cli) (built: Sep 21 2016 12:37:50)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
To verify that apache is running with the necessary modules, for example the php5 module, you can use the command
apache2ctl -M
This command will return something like:
Loaded Modules:
core_module (static)
so_module (static)
watchdog_module (static)
http_module (static)
log_config_module (static)
logio_module (static)
version_module (static)
unixd_module (static)
access_compat_module (shared)
alias_module (shared)
auth_basic_module (shared)
authn_core_module (shared)
authn_file_module (shared)
authz_core_module (shared)
authz_host_module (shared)
authz_user_module (shared)
autoindex_module (shared)
deflate_module (shared)
dir_module (shared)
env_module (shared)
filter_module (shared)
mime_module (shared)
mpm_prefork_module (shared)
negotiation_module (shared)
php5_module (shared)
setenvif_module (shared)
status_module (shared)
Alternatively to use these commands you can create an index.php file on your server (/ var / www / html) and within this place:
<?php
echo phpinfo();
?>
With that you check the PHP version and all the modules available for PHP in Apache for example the php5-mysqlnd
module that allows the connection between PHP and MySQL.