php - How to install Predis on app service? -
i using azure app service application requires predis extension installed on server, how can have installed on app services? application in php.
you can package predis sdk in application , deploy azure web apps service via git or ftp. create php-mysql web app in azure app service , deploy using git more info.
additionally, can configure predis sdk in composer.json.
"require": { "predis/predis": "1.*" }
then install composer extension in azure web apps service. when deploying azure via git, azure deployment task run composer install command install dependencies , composer commands configured in file.
you can refer how install composer on app service? installing composer extension
additionally, if leverage redis cache in azure, should enable non-ssl endpoint php integration @ first:
and code snippet:
require 'vendor/autoload.php'; $client = new predis\client('redis://{your_redis_service_name}.redis.cache.windows.net'); $client->auth('{password key}'); $client->set('foo', 'bar'); $value = $client->get('foo'); echo $value;
Comments
Post a Comment