Access data with url


#1

Hello all

Fairly new to this

I am on the free tier and have successfully set up a small MySQL database on GearHost and also added a CloudSite. Following the instructions I was able to upload phpMyAdmin files to the CloudSite and can access the data on the database. This is great!

Now I am trying to access the data using a url, and this is where I am getting stuck. I’ve moved the database from AWS, and with the AWS setup I could use a url similar to the following and the data would appear on the webpage: “http://ec2-user@ec2-51-44-124-162.eu-central-1.compute.amazonaws.com/testget.php”; however I’m getting an error if I try the same thing with GearHost, i.e. if I type in “http://kantorapp.gear.host/testget.php”, the error is "An attempt was made to access a socket in a way forbidden by its access permissions."
I have uploaded the php file to … /site/wwwroot and can access other files there fine. It looks like I have made an error in the php file somewhere - or is there a setting on GearHost that I should change (“read/write” is enabled)? Or am I doing something else wrong?
Any pointers appreciated.

Thank you

Regards
Nick


#3

Well after lots of trial and error and reading StackOverflow, and GearHost docs, I finally got the result I was after!

One thing I did was add a connection string in the CloudSite, see https://www.gearhost.com/documentation/connection-strings

Also I had to upgrade my PHP syntax to PHP 5 - and I was able to see any errors by enabling PHP error debugging, see https://www.gearhost.com/documentation/troubleshooting-wordpress#user-content-enable-php-error-debugging

Good luck!