Reply
Regular Contributor
ethanone
Posts: 79
0

REST with PHP

[ Edited ]

I'm trying to work through the cookbook recipie here: http://developer.force.com/cookbook/recipe/interact-with-the-forcecom-rest-api-from-php

 

The environment I'm using is:

Ubuntu 11.10 with out of the box LAMP and SSL configured running in VMWorkstation 8 using bridged networking (192.168 address on my LAN).

I've tried this with a sandbox and a DE org.

 

The problem I'm having:

When I run in the sandbox (with proper credentials) I get a blank page at the end - no records.

When I run in the DE org (with proper credentials) I get this error (wiith code truncated)  "The website encountered an error while retrieving https://192.168.1.149/resttest/oauth_callback.php?code=aPrxrw6I. It may be down for maintenance or configured incorrectly." I thought this was a network thing since I'm not using localhost, but i don't know. I've also tried different Login URI values for the config.php

 

Can anyone offer some guidance?  Thanks in advance.

Regular Contributor
ethanone
Posts: 79
0

Re: REST with PHP

Grrr. Contrary to this statement in the cookbook "You will need the cURL and JSON PHP modules (available by default in most modern PHP environments)." cURL is not installed in the out-of-the-box Ubuntu LAMP install.

 

 

sudo apt-get install php5-curl

sudo service apache2 restart

 ...and it works.