how to validate that php is working on debian 8?

1

I just installed debian on my computer to use it as a server and I have installed php, mysql and phpmyadmin but I do not know how to validate that if I install them well since the interface is by means of commands, so I would like to know what commands I can use to validate that I have been well installed these programs.

    
asked by Christian Dagnover 26.10.2016 в 19:06
source

2 answers

3

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.

    
answered by 26.10.2016 / 19:28
source
2

In the console enter the following command:

 php -v

should return the following message:

 Copyright (c) 1997-2014 The PHP Group
  Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
  with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies

Greetings.

    
answered by 26.10.2016 в 19:21