Notes on installing redis on mac and opening phpredis extension ----

Method address: http://www.jianshu.com/p/af33284aa57a

 

    The above address explains how to install redis on a computer that has been configured with m (mac) a (apache) m(mysql) p(php) and configure phpredis according to one ---> two ---> four ( 1) The steps to complete the installation, as for modifying the configuration file, you only need to add a sentence to the ini file corresponding to PHP: extension="redis.so", and it should be noted that: install in the content of four (1) It is the phpredis extension of PHP55. I am using PHP7.0, so the result of changing 55 to 70 without authorization is: in the apache configuration file, modify the linked php.so to annotate the original 7.0.18, as follows The 7.0.22 that has been generated and referenced does not move, after which redis can be successfully run.

    Regarding reids, after running through the redis-server /usr/local/etc/redis.conf command on the terminal, you need to start another terminal to use the corresponding terminal command of redis. Because this instruction represents the foreground program, closing the terminal will terminate the process, but there is also an instruction that can run in the background, not limited to a fixed terminal.

    Another point is that if the restart command of apache returns httpd not running, trying to start, and then start returns httpd (pid 46942) already running, stop first and then start.

  Another thing is

(The following content is taken from the rookie tutorial , this dish only uses the rookie verification service, and the other installation procedures follow the blog steps at the beginning of this article)

To see if the service is running:

$redis = new Redis();

$redis -> connect('127.0.0.1',6379);

echo "connection to server successfully";

//Check if the service is running

echo "server is running:" . $redis->ping();

 The output is:

connection to server successfully

server is running:+PONG

 

 

 

ps: This dish uses the brew installation, so the process is very simple, and there are many fewer steps, and after the installation is completed, two instructions to run redis will be prompted directly

To have launchd start redis now and restart at login:

  brew services start redis

Or, if you don't want/need a background service you can just run:

  redis-server /usr/local/etc/redis.conf

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326945510&siteId=291194637