Will Predis be able to interact with a newer Redis version? - php

I'm working on writing a script to compare a couple caching methods my team will be using. I'm trying to set up a Predis client that will interact with the Redis already running there. The Redis that is running on the server is clocking in at version 4.0.9, while the latest predis notes list support for Redis profiles from 2.0 to 3.2. I was just wondering if the functionality of simple commands that have existed since 3.2 of Redis will function the same when using predis with our 4.0 config. If not, would I be able to just use exec to go through as if I was just using the command line interface?

As far as I remember there were no API breaking changes for "simple" commands since 3.2. That said, it is possible that you won't be able to use the newer commands. Perhaps you should consider using Phpredis that is more up to date and maintained.

Related

I have developed am application using PHP7 but on the server there is PHP5 and we cannot upgrade the PHP there

Please help me, I have developed an application using Yii2 Framework which requires PHP5.6 or greater, and while deployment of the application on the test server I have noticed that on the test server we are using PHP5.5, So please tell me what can I do? The test server is running Ubuntu.
(Minimum requirement of Yii2 is PHP5.6 and we are using PHP5.5)
Thank You.
if I recall correctly, PHP 5.5.X and 5.6.X are not that different. So if you can deploy your application and it runs properly, you should be fine. If you are using composer, it might be harder (or impossible) to spoof your PHP version, though.
My two cents:
You tagged AWS (and therefor probably EC2), so why don't you just update your PHP version? Why don't you run your application on PHP 7.X anyway? It is a great improvement - performance-wise.
You can try a few things...
1) Do you need to have the dev modules from Composer on the test server? If not do a composer install —no-dev
2) Another switch worth trying on the test server is “--ignore-platform-reqs” I don’t recommend it and even though composer install the files the application might not work.
3) If the above isn’t a fix for you, modify your Composer file to put in the constraints of your environments, change your local environment to match the test server, and re-factor the application if necessary. I’d do that instead of rewriting a whole app in Yii1.
You might want to edit your question and add the information about your composer.json file. Do you commit the composer.lock file to source control?
Additionally, not wise for your company to use anything older than PHP 5.6. And PHP 5.6 will have security support ended in Dec 2018. http://php.net/supported-versions.php
Read the following PHP documentation linked below, particularly the backward incompatibility changes and deprecated features. If you use any of those, you need to change your code. If you don't, then you should be fine. You need to test it.
http://php.net/manual/en/migration56.php

Is there a PHP 5.5 buildpack with APC (Alternative PHP Cache)?

Can I use APC (Alternative PHP Cache) in my Bluemix PHP environment?
I added { "PHP_EXTENSIONS": ["apc"] } to my options.json file but when I tried that to deploy a message said that apc wasn't included in the buildpack. I need PHP 5.5 so I'm using php-buildpack#v4.3.2. Can you suggest a buildpack that includes APC?
I need an in-memory cache to replace Laravel's file cache. If I can't use APC, can anyone suggest anything else?
The Bluemix default PHP buildpack, which is listed in the admin catalog, is v4.1.5. This version supports both PHP 5.5 and APC. So you can bring your local environment to be compatible with PHP buildpack 4.1.5 to develop app on this version of buildpack.
PHP 5.5 and later come bundled with the OpCache, which supercedes the APC.
If you have code that uses the APC functions, you can continue using them in PHP 5.5 by using the APCu extension. APCu is APC, but with the opcache part removed (so that you can use the built-in OpCache instead), just leaving the memory cache and PHP functions to access it.
References:
http://jessesnet.com/development-notes/2014/php-55-opcache-apcu/
http://php.net/manual/en/migration55.new-features.php
http://php.net/manual/en/book.apcu.php
https://pecl.php.net/package/APCu
To close things out: I used php-buildpack#v4.1.5 which includes apc though it's based on PHP 5.4 so I had to down-level my guzzle to 5.3.0 which meant I needed to modify my guzzle code since I was using the guzzle 6 apis. I then changed my Laravel cache calls to use apc. Surprisingly, after all that the app still works, though whether it's really any faster is hard to tell

How to use MemcacheD instead of Memcache on PHP and Windows Xampp?

Sorry but, I've searched this question and I found a lot of old answers.
Now, I can use memcacheD instead of memcache on windows?
http://www.codeforest.net/how-to-install-memcached-on-windows-machine
I installed php_memcache.dll extension and memcached.exe server service, but this is memcache! (without "D"). in fact if I use
new Memcache;
it works fine, instead if I use:
new Memcached;
or
new MemcacheD;
doesn't work.
I would like to implement memcacheD (with "D" !!!) because I will use it on amazon Elasticache together Zend Framework Cache/Session and it works with memcacheD. Now I'm working in Xampp (windows) ambient. How to work with memcacheD in windows? I need another libraries?
Thanks a lot, I'm fighting for using this -.-
I'm using Win7 (64bit).
My DDL file is available here (php 5.6 - 5.6 Thread Safe (TS) x86):
http://pecl.php.net/package/memcache/3.0.8/windows
My memcached server version is 1.4.4 32bit version, available here
http://blog.elijaa.org/index.php?post/2010/10/15/Memcached-for-Windows&page
You're confusing the two. memcached is the Memcache daemon program (the d stands for daemon). This has to be running for you to use Memcache. This is NOT what you use inside PHP. You launch this inside Windows like you would any other program.
The Memcache PECL library is how you can connect to your running daemon. You use new Memcache inside PHP to create an object that connects to the daemon and then interacts with it.
I've been struggling with this myself, and it seems that the only solution is to compile the DLL yourself from source, because there are no official Windows binaries for the PHP memcached extension available. This is a related question: Does memcached.dll exist?

Using Redis, Predis with my php application

As I was developing a php app I realised that my app is slow in terms of processing large sets of data in the catche. Decided to do something about it and went on to google to find some sort of solution or at least suggestions.
I came across Redis, after reading about it I would realy like to give it a go and test it out as it looks promising,
But I also stumbled into predis and phpredis, and thats when I begun to get confused. From what I understand i need predis or phpredis with my php app, but then where do I use Redis....? how should I build my stack...?
Redis->predis->php
Do I have to install both Redis and Predis/phpredis within my PHP directory in eg. lib dir..?
Also is there any significant difference between Redis and Phpredis
Redis is a standalone caching application: http://redis.io/ (plenty of documentation on how to install)
predis is a library for interacting with a running Redis application easily from within php. Phpredis is similar but requires compiling.
You can think of it like MySql and PHP. MySql is it's own application that you are able to communicate with via a PHP extension, MySql itself is not a part of PHP.
Your stack could be (apache / php5.3 / mysql / redis) with just the predis library.
You can run redis either on the same server or a different server, it's up to you.
Redis is a server that runs independently from your application (i.e. PHP) code. You can download it from here.
To talk to Redis, your application can do one of the following:
Implement Redis' protocol, i.e. RESP
Use a client library
Most people go for option 2, which in PHP's case your options would be predis, phpredis or any of the other clients in the clients page or others that are unlisted by you can find in GitHub.

Couchbase 2.0 and php5.4

Is anyone using couchbase 2.0 with PHP 5.4? I ask because the PECL libraries for PHP appear to not support PHP5.4's new interfaces. This is a real bummer as I'd really like to start taking advantage of 5.4's support for JsonSerializable which would appear to be a nice compliment to folks living in the JSON world of Couchbase.
I've used PHP 5.4.x, specifically I used the Bitnami MAPP stack, which comes with the couchbase.so already built for 5.4 (although you can do that yourself easily from the source). Then connected it to my local Couchbase instance (in my case I used the Laravel framework).
My Blog: http://blog.couchbase.com/easy-php-couchbase-setup-mac-bitnami
But now the couchbase.so is already in the Bitnami stack... so you can skip that part.
Bitnami MAPP: http://bitnami.com/stack/mapp
Bitnami MAMP: http://bitnami.com/stack/mamp (also can be installed via Mac App Store)

Categories