mercredi 18 mai 2016

PHP Laravel 5.2 predis package instalation

I have problem with redis on laravel. I have same projects on windows and linux. After instaling the 'predis/predis' package from composer everything works on Windows.

$ composer require predis/predis
You are running composer with xdebug enabled. This has a major impact on runtime performance. See http://ift.tt/1NnGiU0
Using version ^1.0 for predis/predis
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing predis/predis (dev-master d55826f)
    Cloning d55826f35cbce2e1125d91500ccfa00ee1a82a8d

predis/predis suggests installing ext-phpiredis (Allows faster serialization and deserialization of the Redis protocol)
Writing lock file
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postUpdate
> php artisan optimize
Generating optimized class loader

$ php artisan tinker
Psy Shell v0.7.2 (PHP 7.0.6 ÔÇö cli) by Justin Hileman
>>> Redis::connection()
=> Predis\Client {#717}
>>>

But on debian i have an issue like this:

logic@test:~/www/gps-dev-5.2$ php composer.phar update
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing predis/predis (dev-master d55826f)
    Loading from cache

predis/predis suggests installing ext-phpiredis (Allows faster serialization and deserialization of the Redis protocol)
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postUpdate
> php artisan optimize
Generating optimized class loader


logic@test:~/www/gps-dev-5.2$ php artisan tinker
Psy Shell v0.7.2 (PHP 5.6.20-0+deb8u1 — cli) by Justin Hileman
>>> Redis::connection()
PHP Fatal error:  Call to undefined method Redis::connection() in eval()'d code on line 1
>>>

In order to get an instance of class i need to specify particular namespace

>>> Illuminate\Support\Facades\Redis::connection();
=> Predis\Client {#725}

Anyone had similar problem? I asume something with directory perms but i'm not 100% sure.

Laravel 5.2,

Windows PHP 7.0,

Debian PHP 5.6



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1rTwlL3
via IFTTT

Aucun commentaire:

Enregistrer un commentaire