JSON RPC call from webpage to Bitcoin Core I want to make API calls to my Bitcoin Core wallet from my webpage but when I try to connect it gives me Internal Server Error

I'm using easybitcoin.php JSON from Github.

I'm trying with this JSON RPC call:

require_once('easybitcoin.php');
    $bitcoin = new Bitcoin('myusername','mypassword','myip','8332');
    $bitcoin-&gt;getinfo();


My bitcoin.conf file has:


listen=1
maxconnections=15
server=1
daemon=1
rpcuser=myusername
rpcpassword=mypassword
rpcclienttimeout=60
rpcport=8332
rpcallowip=0.0.0.0/0 (Before I put my IP address here but it didn't solve too)


When I use bitcoin-cli.exe client to send commands to my Bitcoin Core server via 127.0.0.1 (localhost) it works perfectly.

What I'm doing wrong?
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.