JSON RPC call from webpage to Bitcoin Core
Make sure your 8332 port is open using ufw. Some VPS providers only have very few open by default for security. Digitalocean, for example doesn't have it open by default anymore.

sudo ufw allow 8332

Easybitcoin library uses cURL, and it's not always enabled or installed by default.

With PHP 5, you can easily install it by running  apt-get install php5-curl command. 
With PHP7, sudo apt-get install php-curl

Once installed make sure its enabled. Locate your php.ini file and uncomment ;extension=php_curl.dll this line by removing ;(semi colon).

Run a test page with phpinfo(); and make sure curl is installed and enabled.  Restart Apache, sudo service apache2 restart.

If you still can't get it to work go back to your php.ini file and turn on all error reporting and let us know what the error is. Be sure you turn the error messages off again before you go live.