0

i want to implement pubnub at my company (i'am currently developping a workflow website). SSL and authentification are used. On a test page, i used javascript library to subscribe to pubnub with my id, a callback works perfectly when i publish via javascript. From this page i have a link to a php page where i want to publish to the same channel with the same id :

require('../scripts/pubnub/3.1/Pubnub.php');
$pubnub = new Pubnub( $publish_key, $subscribe_key );

## Get History

echo("Requesting History...\n");
 $messages = $pubnub->history(array(
'channel' => $channelName
'limit'   => 100
));

but the page return a 500 error after several minutes.

Dev Console on my company intranet doesnt work any more.

Does somebody has any idea about the problem ? And specially about solutions !

maybe i need to use another php web server to publish via php ?

Aureltime
  • 373
  • 3
  • 10

1 Answers1

0

Please use our latest 3.3 version here:

https://github.com/pubnub/pubnub-api/tree/master/php/3.3

Be sure to use detailedHistory() and not history(), as history() is deprecated.

Also, examples for usage are available in the tests, and also in the pubnubPlaintextTests.php file.

Also, I would open up a web console in Firefox, and one in Chrome to the same keys/channel:

www.pubnub.com/console

And be sure you can communicate two-way using that configuration -- that should rule out any sort of network / firewall issues at your location.

Geremy
  • 2,415
  • 1
  • 23
  • 27
  • thanks for advice.I already tried with 3.3 version (no more success) but i'll try again from work tomorrow. I'll check examples again to try to make that work in the intranet of the company. About dev console, it is i wrote in the first message, but let me be more specific : when i click on subscribe nothing happens. I'll check tomorrow what my browser console says. – Aureltime Oct 29 '12 at 19:42
  • great, if it doesn't work even in the dev console, it is probably a firewall issue that needs to be resolved first. – Geremy Oct 30 '12 at 00:21
  • just did the test on console with browser console on : [link](http://hpics.li/dc753c4) : Chrome [link](http://hpics.li/94d4242) : Firefox didnt go through firewall, i dont have control on the network. Why does the publish viajavascript work ? do you thing using REST can sold the issue of publishing ? – Aureltime Oct 30 '12 at 05:40
  • Additional test : on [link](http://www.pubnub.com/tutorial/http-rest-push-api), the publish test works but when i try to implement it via curl in a php page, when i run this php page, the statut of it is pending during 1.4 minutes and no callback function called. – Aureltime Oct 30 '12 at 08:01
  • Can you please contact me at support at pubnub dot com, and send me the following: 1) screenshot of the chrome Network tab when loading our web console, 2) the output of pasting this command in your chrome browser: http://pubsub.pubnub.com/publish/demo/demo/0/hello_world/0/%22hello!%22 – Geremy Oct 30 '12 at 17:19