#phpredis
Explore tagged Tumblr posts
Text
0 notes
Text
Cómo montar un servidor de alto rendimiento con VestaCP

Cómo montar un servidor de alto rendimiento con VestaCP en CentOS 7. Hoy en día la velocidad de un sitio web es fundamental, de hecho cada día tiene más relevancia de cara al SEO. Por ello, vamos a crear dos artículos correlativos donde explicaremos como montar tu propio servidor o VPS de alto rendimiento. Cómo montar un servidor de alto rendimiento con VestaCP con CentOS 7. Cómo optimizar Nginx con PHP-FPM en VesctaCP con Centos 7. Alguna vez me han preguntado porqué monto mis servidores con CentOS 7... bueno, tambien utilizo Debian, pero la verdad es que CentOS me parece mucho más versátil y abierto a cambios si lo comparamos con Debian, también por costumbre. No es necesario puntualizar que estas instrucciones son válidas para cualquier servidor o VPS, aunque si necesitas un servidor dedicado totalmente administrado desde 15€, ponte en contacto con nosotros y te informaremos.
Montar un servidor de alto rendimiento con VestaCP
Instalar VestaCP Partimos de la base que ya tienes VestaCP instalado con Nginx y php-fpm, si no es así... desde su página oficial puedes generar los comandos de instalación. Una buena selección es la que te indico en la siguiente imagen. No instales softaculos, es muy pesado y no es totalmente gratis (está capado, muy capado).
Configuración de VestaCP Una vez instalado, lo primero que debemos hacer es actualizar e instalar el repositorio epel. yum update yum install epel-release yum update Dependiendo de la versión que tengas de CentOS 7, se habrá instalado php 5.4, o php 5.6, esto es inadmisible. Si o si, debes instalar php 7.1 o superior. Mi recomendación a dia de hoy es php 7.2, ya que es la máxima que es 100% compatible con todos los plugins y temas de Wordpress modernos. Actualizar PHP en VestaCP Para actualizar la versión de php debes habilitar el repositorio remi con la versión php que más te interese. PHP 7.1 yum-config-manager --enable remi-php71 PHP 7.2 yum-config-manager --enable remi-php72 PHP 7.3 yum-config-manager --enable remi-php73 PHP 7.4 yum-config-manager --enable remi-php74 Actualizamos el sistema y reiniciamos php-fpm. yum update systemctl restart php-fpm Instalar Opcache en VestaCP La instalación de Opcache en VestaCP con Centos 7, es muy simple. Sigue los pasos indicados. yum install php-opcache systemctl restart php-fpm systemctl restart nginx Fácil verdad?. Si quieres modificar las opciones de opcache revisa el articulo anterior. Actualizar MariaDB en VestaCP De manera predeterminada, CentOS 7 viene con MariaDB 5.5. Es altamente recomendable actualizar como mínimo a MariaDB 10.3. Primero hacemos una copia de seguridad por si acaso. cp -a /var/lib/mysql/ /var/lib/mysql.bak También necesitamos hacer un dump en temporales (inserta tu password root). mysqldump -u root -Passdelroot --all-databases > /tmp/all-database.sql Creamos el repositorio de MariaDB 10.3. nano /etc/yum.repos.d/MariaDB10.repo Copia y pega lo siguiente: # MariaDB 10.3 CentOS repository list - sololinux.es # name = MariaDB baseurl = http://yum.mariadb.org/10.3/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 Guarda el archivo y cierra el editor nano. OJO!!!, antes de actualizar es conveniente borrar la versión anterior. yum remove mariadb-server mariadb mariadb-libs Limpiamos la cache de los repositorios de CentOS 7. yum clean all Instalamos la nueva versión de MariaDB. yum -y install MariaDB-server MariaDB-client Una vez termine la actualización, iniciamos y habilitamos MariaDB 10.3. systemctl start mariadb systemctl enable mariadb # o systemctl enable mariadb.service Importamos los datos anteriores (en caso de que los tuviéramos). mysql_upgrade Para concluir esta sección, actualizamos el sistema y verificamos la versión instalada de MariaDB. yum update mysql -V ejemplo de salida... # mysql -V mysql Ver 15.1 Distrib 10.3.22-MariaDB, for Linux (x86_64) using readline 5.1 Instalar Redis en VestaCP Redis es sistema de almacenamiento de datos estructurados en memoria, muy útil como memoria caché. Instalamos Redis ya que su rendimiento es superior a otras alternativas. yum install redis Iniciamos Redis y lo habilitamos para que arranque con el sistema. systemctl start redis systemctl enable redis.service # o systemctl enable redis Habilitar Redis en Wordpress con VestaCP Si utilizas WordPress para crear tus sitios, es interesante agregar Redis como su sistema de almacenamiento en caché. Lo instalamos: yum install php-devel Ahora agregamos la extensión PHPRedis. pecl install redis Pulsa enter cuando aparezcan mensajes similares a... enable igbinary serializer support? Para concluir es necesario agregar la extension a nuestro php.ini. nano /etc/php.ini Al final del archivo agrega la siguiente linea. extension=redis.so Un plugin de cache que funciona muy bien con Redis es "W3 Total Cache". En su configuración elije 'Redis' como caché de página y caché de base de datos, después marca la casilla de verificación 'habilitar' en cada opción antes de hacer clic en el botón 'Guardar todas las configuraciones'. Esta configuración se debe hacer antes de reiniciar php-fpm y Nginx. Como punto final al articulo reiniciamos php-fpm y nginx. systemctl restart php-fpm systemctl restart nginx Canales de Telegram: Canal SoloLinux – Canal SoloWordpress Espero que este articulo te sea de utilidad, puedes ayudarnos a mantener el servidor con una donación (paypal), o también colaborar con el simple gesto de compartir nuestros artículos en tu sitio web, blog, foro o redes sociales. Read the full article
#ActualizarMariaDBenVestaCP#ActualizarPHPenVestaCP#centos7#debian#editornano#HabilitarRedisenWordpressconVestaCP#InstalarOpcache#InstalarRedisenVestaCP#InstalarVestaCP#phpredis#repositorioEpel#repositorioremi#servidordealtorendimiento#softaculos#vestacp#VestaCPenCentOS7#W3TotalCache#wordpress#WordpressenVestaCP
0 notes
Text
Elefant 2.2.3
Elefant 2.2.3 has been released with a number of bug fixes and improvements.
Click here to download or update.
Simpler request data validation for REST endpoints
The Restful class has a new get_params() method that makes it easier to parse and validate request data parameters while also improving the conciseness and readability of your code.
Previously, you might write code like this in order to parse and validate request data:
$data = $this->get_put_data (true); if (! isset ($data->id)) { return $this->error ('Missing parameters: id', 400); } if (! isset ($data->name)) { return $this->error ('Missing parameters: name', 400); } // etc.
Now you can write this to do the same thing:
$data = $this->get_params (['id', 'name']); if (! $data) return; // Validation failed
If $data is false, Restful will automatically send an appropriate error response, so you can simply return without having to write any additional error handling logic.
When you pass it an ordinary array, get_params() considers all fields specified to be required, and omits all others. Note that you can still get the full, unvalidated list like this:
$data = $this->get_params ();
However, you can do much more with get_params(), including using booleans to specify required versus optional fields:
$data = $this->get_params ([ 'id' => true, // required 'name' => false // optional ]);
And you can take it one step further by specifying an array of input validations that will be sent to the Validator class like this:
$data = $this->get_params ([ 'id' => true, 'name' => false, 'email' => [ 'email' => true ], 'age' => [ 'skip_if_empty' => true, 'type' => 'numeric', 'range' => '1-150' ] ]);
This also makes it easier to see the expected parameters and their validation rules all in one place at the top of your endpoint methods, using the same validation rules that forms and models also use.
Custom CSS class selector for content blocks
The blocks editor now provides a way to select and set custom CSS classes on individual blocks via a dropdown menu.
The editor looks for a layouts/your-theme/blocks.css file in your layouts and reads that for custom CSS classes. If not found, it reads all layouts/your-theme/*.css files and parses them for custom CSS classes.
It looks for any CSS class of the form .block-outer.custom-class-name, for example:
.block-outer.dark-background { background-color: #222; color: #eee; }
It then turns all unique classes found into selectable options in a dropdown list (the above would appear as "Dark Background") so you can offer your site editors more customization options without sacrificing control over the look and feel of your sites.
This is especially powerful coupled with other recent improvements to the blocks/group helper.
Other bug fixes and improvements
All Elefant-related cookies are now marked with SameSite=Lax
Changed $cache->delete() to use unlink() for asynchronous deletions on newer versions of phpredis
Improved the display and usability of tables in the wysiwyg editor
Fixed a MySQL error at a text field with default value
Fixed custom site styles affecting the Elefant toolbar heading colours and embedded button styles
Click here for the full list of changes.
#cms#content management#php cms#php#php framework#framework#frameworks#web framework#web development#open source#free software#updates#news#new releases#restful#rest#apis#rest api#responsive design#css#grid layout#wysiwyg
1 note
·
View note
Link
This article guides how to install a redisphp extension for PHP v7.4 command on CentOS/RHEL 8 to access the Redis server/cluster.
1 note
·
View note
Photo

PhpRedis vs Predis: Comparison on real production data ☞ https://medium.com/@akalongman/phpredis-vs-predis-comparison-on-real-production-data-a819b48cbadb #php #Laravel
1 note
·
View note
Text
Laravel devops
Laravel devops Laravel devops Daily news Laravel devops Laravel 6 PHP Redis On upgrading to Laravel 6 we ran into issues locally running predis. This as no client was set in .env and now config was going for native PHP Redis or phpredis. Local Fix To fix this locally and keep on using Homebrew we added a simple line to our local .env to keep on using predis and Homebrew based Predis instead of…

View On WordPress
0 notes
Text
RedisBundle - This bundle integrates Predis and phpredis into your #Symfony application https://t.co/fkoBo9dDKw #PHP #Redis https://t.co/E9V9vODcRI
RedisBundle - This bundle integrates Predis and phpredis into your #Symfony application https://t.co/fkoBo9dDKw #PHP #Redis pic.twitter.com/E9V9vODcRI
— Macronimous.com (@macronimous) February 20, 2020
from Twitter https://twitter.com/macronimous February 21, 2020 at 01:37AM via IFTTT
0 notes
Link
PhpRedis is faster about x6 times. Using igbinary serializer reduces stored data size about 3x times. If Redis installed on separate machines, reducing network traffic is a very significant speedup.
0 notes
Photo

PhpRedis vs Predis: Comparison on real production data ☞ https://medium.com/@akalongman/phpredis-vs-predis-comparison-on-real-production-data-a819b48cbadb #php #Laravel
0 notes
Photo

PhpRedis vs Predis: Comparison on real production data ☞ https://medium.com/@akalongman/phpredis-vs-predis-comparison-on-real-production-data-a819b48cbadb #php #Laravel
0 notes
Text
Redis Cache By Xon
Xon submitted a new resource: Redis - XenForo + Redis
This add-on uses Credis with a custom cache provider for Redis. For best performance, install the php extension: phpredis Troubleshooting Please be aware that Redis is very sensitive to latency in a... Click to...
Click to expand...
Redis Cache By Xon
source https://xenforoleaks.com/index.php?threads/redis-cache-by-xon.2287/
0 notes
Text
とりあえず、composerで使えるpredisに。predisの方は開発が止まってるっぽいので、困ってきたらphpredisに乗り換えるかも。 https://t.co/J5P81OpFnH
とりあえず、composerで使えるpredisに。predisの方は開発が止まってるっぽいので、困ってきたらphpredisに乗り換えるかも。https://t.co/J5P81OpFnH
— m (@m3816) November 23, 2018
from Twitter https://twitter.com/m3816 November 23, 2018 at 11:39PM
0 notes
Text
Compiling phpredis on Zend Server CE/OSX Lion
Download phpredis source code from https://github.com/nicolasff/phpredis git clone git://github.com/nicolasff/phpredis.git
By default, compiling PHP extension on OSX Lion will generate a 64bit binary. However, Zend Server CE only support PHP 32bit. Therefore, I must compile phpredis in 32bit architecture. phpize ./configure CFLAGS="-arch i386" make
Verify if phpredis is 32bit (Mach-O bundle i386) cd ./modules file redis.so
If so, copy redis.so to Zend Server CE's PHP extensions folder: sudo cp redis.so /usr/local/zend/lib/php_extensions
Restart Zend Server CE: sudo /usr/local/zend/bin/zendctl.sh restart-apache
31 notes
·
View notes
Text
phpredis, 2 Fast 2 Furious

Redis (REmote DIctionary Server) is a persistent key-value database with built-in net interface written in ANSI-C for Posix systems. Whilst it may at first seem like the wheel is being reinvented here, the need for something beyond a simple key-value database is pretty clear. It’s possible to use Redis like a replacement of memcached, with the main difference being the dataset is stored persistently – not volatile data – and Redis introduces new data structures such as list and sets. Furthermore, it implements atomic operations in order to interoperate with these data structures.
I released a PHP extension called phpredis a couple of weeks ago, which works as a PHP client API for Redis. The project is hosted at Google Code at the moment, and you can get the code directly from the SVN repository: http://phpredis.googlecode.com/svn/trunk/.
Despite a vanilla PHP client library already exists, I felt the need to write it since a PHP extension normally performs better and I wanted to make the most of Redis potential.
Let’s see a snippet of how to make a simple operation to Redis using the PHP client:
$redis = new Redis(); $redis->connect('127.0.0.1', 6379); $redis->set('key', 27); echo $redis->get('key'); // it should print 27 $redis->incrby('key', 3); echo $redis->get('key'); // it should print 30
The code above was quite obvious, it stored a value associate to key and it increments its value by 3. Let’s see another snippet a bit more complex, for example using a list:
$redis = new Redis(); $redis->connect('127.0.0.1', 6379); $redis->lPush('list', 'val'); $redis->lPush('list', 'val2'); $redis->lPush('list', 'val3', 1); echo $redis->lPop('list', 1); // it should print val3 echo $redis->lPop('list'); // it should print val2 echo $this->lPop('list'); //it should print val
Notice that depending on the last optional parameter (0 by default) it’s possible to append/extract an element to/from the tail or to/from the head of the list.
There is a list including all the available methods. At the moment, I’m working on the implementation of more new Redis commands and on the support for complex data structures such as arrays and PHP objects.
Apart from phpredis, there are more client API for languages as Perl, Python, Ruby and Erlang. You can find this and more at the Redis project homepage. Redis has been written by Salvatore Sanfilippo who I’m chuffed to bits with.
1 note
·
View note
Text
RedisBundle - This bundle integrates Predis and phpredis into your #Symfony application https://t.co/TUCbwhKOXl #PHP https://t.co/8EVeK9YM60
RedisBundle - This bundle integrates Predis and phpredis into your #Symfony application https://t.co/TUCbwhKOXl #PHP pic.twitter.com/8EVeK9YM60
— Macronimous.com (@macronimous) November 22, 2019
from Twitter https://twitter.com/macronimous November 23, 2019 at 12:50AM via IFTTT
0 notes