#!/bin/sh
# From: Athmane Madjoudj <athmanem@gmail.com>

echo "<?php echo phpinfo(); ?>" > /var/www/html/test.php
echo -n "Testing PHP on localhost:  "
echo -e "GET /test.php HTTP/1.0\r\n" | nc  localhost 80 | grep 'PHP Core' > /dev/null 2>&1
if [ $? -eq 0 ]; then
	echo 'PASS'
else
	echo 'FAIL'
        exit 1
fi
