My PHP script dies executing preg_match_all with NO errors of any kind. The script takes an input string as its main argument and then iteratively executes the preg_match_all, searching the input string for max number of patterns. When the input string gets over 7K (closer to 8K) only then does this problem occur. The bigger the input string, over 7K, the fewer times the "preg_match_all loop" executes.
So if, the input string is under 7K the "preg_match_all loop" will continue until it reaches the max number I set. If the input string is 10K it loops three quarters of the max before it dies. At about 20K it loops one quarter of the max before it dies, and etc.
Guesses welcome. Memory issues? Is there a PHP function to measure memory available to the script? How can I debug this?
Other Info:
onfiguration
PHP Core
Directive Local Value Master Value
allow_call_time_pass_reference On On
allow_url_fopen Off Off
allow_url_include Off Off
always_populate_raw_post_data Off Off
arg_separator.input & &
arg_separator.output & &
asp_tags Off Off
auto_append_file /no value/ /no value/
auto_globals_jit On On
auto_prepend_file /no value/ /no value/
browscap /no value/ /no value/
default_charset /no value/ /no value/
default_mimetype text/html text/html
define_syslog_variables Off Off
disable_classes /no value/ /no value/
disable_functions /no value/ /no value/
display_errors On On
display_startup_errors Off Off
doc_root /no value/ /no value/
docref_ext /no value/ /no value/
docref_root /no value/ /no value/
enable_dl On On
error_append_string /no value/ /no value/
error_log /no value/ /no value/
error_prepend_string /no value/ /no value/
error_reporting /no value/ /no value/
expose_php Off Off
extension_dir ./ ./
file_uploads On On
highlight.bg #FFFFFF #FFFFFF
highlight.comment #FF8000 #FF8000
highlight.default #0000BB #0000BB
highlight.html #000000 #000000
highlight.keyword #007700 #007700
highlight.string #DD0000 #DD0000
html_errors On On
ignore_repeated_errors Off Off
ignore_repeated_source Off Off
ignore_user_abort Off Off
implicit_flush Off Off
include_path
.:/usr/local/php5/lib/php:/home/content/a/b/c/abc111/html/Guestbook:/home/content/a/b/c/abc111/html/ob
.:/usr/local/php5/lib/php:/home/content/a/b/c/abc111/html/Guestbook:/home/content/a/b/c/abc111/html/ob
log_errors Off Off
log_errors_max_len 1024 1024
magic_quotes_gpc On On
magic_quotes_runtime Off Off
magic_quotes_sybase Off Off
mail.force_extra_parameters /no value/ /no value/
max_execution_time 30 30
max_input_nesting_level 64 64
max_input_time 60 60
memory_limit 50M 50M
open_basedir /no value/ /no value/
output_buffering 0 0
output_handler /no value/ /no value/
post_max_size 8M 8M
precision 12 12
realpath_cache_size 16K 16K
realpath_cache_ttl 120 120
register_argc_argv On On
register_globals Off Off
register_long_arrays On On
report_memleaks On On
report_zend_debug On On
safe_mode Off Off
safe_mode_exec_dir /usr/local/php/bin /usr/local/php/bin
safe_mode_gid Off Off
safe_mode_include_dir /no value/ /no value/
sendmail_from /no value/ /no value/
sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i
serialize_precision 100 100
short_open_tag On On
SMTP relay-hosting.server1.net relay-hosting.server1.net
smtp_port 25 25
sql.safe_mode Off Off
track_errors Off Off
unserialize_callback_func /no value/ /no value/
upload_max_filesize 8M 8M
upload_tmp_dir /tmp /tmp
user_dir /no value/ /no value/
variables_order EGPCS EGPCS
xmlrpc_error_number 0 0
xmlrpc_errors Off Off
y2k_compliance On On
zend.ze1_compatibility_mode Off Off
So if, the input string is under 7K the "preg_match_all loop" will continue until it reaches the max number I set. If the input string is 10K it loops three quarters of the max before it dies. At about 20K it loops one quarter of the max before it dies, and etc.
Guesses welcome. Memory issues? Is there a PHP function to measure memory available to the script? How can I debug this?
Other Info:
onfiguration
PHP Core
Directive Local Value Master Value
allow_call_time_pass_reference On On
allow_url_fopen Off Off
allow_url_include Off Off
always_populate_raw_post_data Off Off
arg_separator.input & &
arg_separator.output & &
asp_tags Off Off
auto_append_file /no value/ /no value/
auto_globals_jit On On
auto_prepend_file /no value/ /no value/
browscap /no value/ /no value/
default_charset /no value/ /no value/
default_mimetype text/html text/html
define_syslog_variables Off Off
disable_classes /no value/ /no value/
disable_functions /no value/ /no value/
display_errors On On
display_startup_errors Off Off
doc_root /no value/ /no value/
docref_ext /no value/ /no value/
docref_root /no value/ /no value/
enable_dl On On
error_append_string /no value/ /no value/
error_log /no value/ /no value/
error_prepend_string /no value/ /no value/
error_reporting /no value/ /no value/
expose_php Off Off
extension_dir ./ ./
file_uploads On On
highlight.bg #FFFFFF #FFFFFF
highlight.comment #FF8000 #FF8000
highlight.default #0000BB #0000BB
highlight.html #000000 #000000
highlight.keyword #007700 #007700
highlight.string #DD0000 #DD0000
html_errors On On
ignore_repeated_errors Off Off
ignore_repeated_source Off Off
ignore_user_abort Off Off
implicit_flush Off Off
include_path
.:/usr/local/php5/lib/php:/home/content/a/b/c/abc111/html/Guestbook:/home/content/a/b/c/abc111/html/ob
.:/usr/local/php5/lib/php:/home/content/a/b/c/abc111/html/Guestbook:/home/content/a/b/c/abc111/html/ob
log_errors Off Off
log_errors_max_len 1024 1024
magic_quotes_gpc On On
magic_quotes_runtime Off Off
magic_quotes_sybase Off Off
mail.force_extra_parameters /no value/ /no value/
max_execution_time 30 30
max_input_nesting_level 64 64
max_input_time 60 60
memory_limit 50M 50M
open_basedir /no value/ /no value/
output_buffering 0 0
output_handler /no value/ /no value/
post_max_size 8M 8M
precision 12 12
realpath_cache_size 16K 16K
realpath_cache_ttl 120 120
register_argc_argv On On
register_globals Off Off
register_long_arrays On On
report_memleaks On On
report_zend_debug On On
safe_mode Off Off
safe_mode_exec_dir /usr/local/php/bin /usr/local/php/bin
safe_mode_gid Off Off
safe_mode_include_dir /no value/ /no value/
sendmail_from /no value/ /no value/
sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i
serialize_precision 100 100
short_open_tag On On
SMTP relay-hosting.server1.net relay-hosting.server1.net
smtp_port 25 25
sql.safe_mode Off Off
track_errors Off Off
unserialize_callback_func /no value/ /no value/
upload_max_filesize 8M 8M
upload_tmp_dir /tmp /tmp
user_dir /no value/ /no value/
variables_order EGPCS EGPCS
xmlrpc_error_number 0 0
xmlrpc_errors Off Off
y2k_compliance On On
zend.ze1_compatibility_mode Off Off