作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我刚刚通过 Homebrew 更新到 PHP7。我现在在执行 php -v
时收到以下错误消息:
PHP Deprecated: PHP Startup: memcached.sess_lock_wait and memcached.sess_lock_max_wait are deprecated. Please update your configuration to use memcached.sess_lock_wait_min, memcached.sess_lock_wait_max and memcached.sess_lock_retries in Unknown on line 0
Deprecated: PHP Startup: memcached.sess_lock_wait and memcached.sess_lock_max_wait are deprecated. Please update your configuration to use memcached.sess_lock_wait_min, memcached.sess_lock_wait_max and memcached.sess_lock_retries in Unknown on line 0
PHP Deprecated: PHP Startup: memcached.sess_lock_wait and memcached.sess_lock_max_wait are deprecated. Please update your configuration to use memcached.sess_lock_wait_min, memcached.sess_lock_wait_max and memcached.sess_lock_retries in Unknown on line 0
Deprecated: PHP Startup: memcached.sess_lock_wait and memcached.sess_lock_max_wait are deprecated. Please update your configuration to use memcached.sess_lock_wait_min, memcached.sess_lock_wait_max and memcached.sess_lock_retries in Unknown on line 0
PHP 7.0.2 (cli) (built: Jan 7 2016 10:40:26) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
with Xdebug v2.4.0RC3, Copyright (c) 2002-2015, by Derick Rethans
谁能告诉我哪里出错了?
我通过 Homebrew 列出并安装了以下软件包。
memcached php56-memcached php70-memcached
谢谢。
最佳答案
我不得不在/usr/local/etc/php/7.0/conf.d/ext-memcached.ini 中注释掉以下条目。
;memcached.sess_lock_wait = 150000
;memcached.sess_lock_max_wait = 0;
数字以微秒为单位(参见 http://php.net/manual/en/memcached.configuration.php )
PHP 7.0+ 中的新设置是:
; The minimum time, in milliseconds, to wait between session lock attempts.
; This value is double on each lock retry until memcached.sess_lock_wait_max
; is reached, after which any further retries will take sess_lock_wait_max seconds.
; Default is 1000.
memcached.sess_lock_wait_min = 1000;
; The maximum time, in milliseconds, to wait between session lock attempts.
; Default is 2000.
memcached.sess_lock_wait_max = 2000;
; The number of times to retry locking the session lock, not including
; the first attempt.
; Default is 5.
memcached.sess_lock_retries = 5;
来源:https://github.com/php-memcached-dev/php-memcached/blob/master/memcached.ini
关于PHP7/MemCache 弃用错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35130463/
我是一名优秀的程序员,十分优秀!