downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Tipos de recursos> <Instalación
Last updated: Fri, 20 May 2011

view this page in

Configuración en tiempo de ejecución

El comportamiento de estas funciones se ve afectado por la configuración de php.ini.

Opciones de configuración de PCRE
Nombre Por defecto Variable Registro de cambios
pcre.backtrack_limit "100000" PHP_INI_ALL Disponible a partir de PHP 5.2.0.
pcre.recursion_limit "100000" PHP_INI_ALL Disponible a partir de PHP 5.2.0.
Para mayor detalles y definiciones de los modos de PHP_INI_*, vea Dónde realizar un ajuste de configuración.

He aquí una breve explicación de las directivas de configuración.

pcre.backtrack_limit integer

Límite de marcha atrás de PCRE.

pcre.recursion_limit integer

Límite de recursividad de PCRE. Por favor, observe que si establece este valor con un número alto puede consumir toda la pila de procesos disponibles y al final provocar que se cuelgue PHP (debido a alcanzar el límite del tamaño de la pila impuesto por el Sistema Operativo).



add a note add a note User Contributed Notes Configuración en tiempo de ejecución
php at richardneill dot org 14-Jan-2011 05:55
pcre.backtrack_limit defaults to 100k.  This is rather conservative.
It is limited by RAM size, not the ulimit on stack-size.

On a (2009-era) netbook, I can set pcre.backtrack_limit to 100 million, and the regex will happily process a 90 million character string in about 3 seconds. YMMV.
chris at ocproducts dot com 02-Jul-2010 02:42
pcre.backtrack_limit sets the maximum bind length PREG calls (e.g. preg_replace_callback) can make. However the actual maximum seems to be approximately half the value set here, possibly due to the character encoding that PCRE runs with internally.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites