I am getting following error during install magento2 on local server. using php v 5.6
Based on your error, your server does not support PHP
make sure your apache server running and your URL like 127.0.0.1/foldername.
It seems PHP is not configured well on your server. Check by creating a file in the root directory where you install PHP and.
phpinfo.php and run this file by
<?php phpinfo(); ?>
If this is working fine then you need to install all PHP modules which is required for Magento2.
Check Magento Docs link: http://devdocs.magento.com/guides/v2.0/install-gde/system-requirements-tech.html
Try to reinstall PHP and its lib using the command below. I've experienced this same issue when I switched from NGINX to Apache.
sudo apt install php-pear php-fpm php-dev php-zip php-curl php-xmlrpc php-gd php-mysql php-mbstring php-xml libapache2-mod-php