Hello, i know it's a problem of mine, but i don't know how to go on. I'm trying to install php lib but when i load my page it says :Fatal error: Class 'Pubnub' not found in /var/www/mywebsite/pubnub.php on line 8. ( at line 8 i have : $pubnub = new Pubnub( 'demo', 'demo' ); I had : 1) $ git clone https://github.com/pubnub/php.git ./pubnub-php - OK 2) copyed composer folder - OK 3) insert require_once('lib/autoloader.php'); /* path is ok */ - OK 4) Add pubnub package to your composer.json file: <----- Here i don't know what to do. - ?? 5) Run composer install from command line <-- terminal say : No command 'composer' found, did you mean: Command 'compose' - ?? thank you all
See this page for full docs:
Note if you have PHP version 5.3 or higher, you have the option of using Composer.
For example on my system, I have PHP 5.4.38 and I don't want to use composer.
I create a new directory
myProject. Next I create a new file
hello.php with the following text:
<?php require_once('lib/autoloader.php'); use Pubnub\Pubnub; $pubnub = new Pubnub('demo', 'demo'); $publish_result = $pubnub->publish('demo','Hello PubNub!'); print_r($publish_result);
Next I clone the Pubnub PHP SDK. Then I copy the
<pubnub-php>/composer/lib into my
myProject directory. My directory structure looks like this:
myProject hello.php lib
Now I can run the file:
myProject$ php hello.php
And it displays the following output:
Array (  => 1  => Sent  => 14286211078724482 )
How I can integrate Pubnub PHP SDK V3.7 with with Codeigniter framework. Facing some exception using autoloader.