2016-02-01 24 views
8

Ho appena aggiornato a PHP7 tramite Homebrew. Io ora ottenere il seguente messaggio di errore quando si fa un php -v:PHP7/MemCache Messaggio di errore deprecato

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 

Qualcuno può suggerire dove sto andando male?

Ho i seguenti pacchetti elencati e installati tramite Homebrew.

memcached php56-memcached php70-memcached

Grazie.

+1

Suppongo che dovresti disinstallare i vecchi pacchetti memcached. Forse [questo] (http://stackoverflow.com/questions/11966640/uninstall-memcached-and-or-force-install-with-homebrew-mac-os-x) potrebbe aiutare a farlo. – trincot

risposta

13

Ho dovuto commentare le seguenti voci in /usr/local/etc/php/7.0/conf.d/ext-memcached.ini.

;memcached.sess_lock_wait = 150000 
;memcached.sess_lock_max_wait = 0; 

I numeri sono in microsecondi (vedi http://php.net/manual/en/memcached.configuration.php)

Le nuove impostazioni in PHP 7.0 e versioni successive sono:

; 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; 

Fonte: https://github.com/php-memcached-dev/php-memcached/blob/master/memcached.ini

+1

Non dimenticare di sostituire questi invece di rimuoverli. L'avvertimento dice: 'Per favore aggiorna la configurazione per usare memcached.sess_lock_wait_min, memcached.sess_lock_wait_max e memcached.sess_lock_retries in Unknown alla riga 0' –

+0

proprio sul naso, risolvendolo per me. – Magus

3

I memcached.sess_lock_wait e memcached.sess_lock_max_wait valori sono stati sostituiti da memcached.sess_lock_wait_min e memcached.sess_lock_wait_max (nota "max" è ormai alla fine del nome della variabile). Modificare questi nomi di variabili e impostare su 0 (per impostazione predefinita) o altri valori come desiderato. Se si utilizzano i valori predefiniti, semplicemente commentare le dichiarazioni fa il trucco.