I’m at my wit’s end. I’ve recently upgraded to PHP 7 (and in the process updated my Apache and MySQL as well) and seem to be having an intermittent issue. I used Apache to set up several virtualhosts and run a few websites. Every so often the sites using PHP freeze up and stop working for 5 minutes or so. During this time I’m able to access any other site as long as it’s strictly HTML, but if php is involved it stops dead. The kicker is it seems that if I access these sites using local host, it runs fine, but attempting to access any of these externally fails. After a few minutes everything goes back to normal and my websites can be accessed as if nothing happened. As I said I’m running the latest PHP, Apache and MySQL, and I do have opache enabled, outside of that I don’t understand these issues. Anyone have any advice?
I don’t see anything in the bug reports that reference the issue you are experiencings.
Sometimes, when I’m developing - In my browser I have another page on my site that’s hanging and then I can’t access any other pages - until the first page is finished processing in the browser. Then I just close all my browser sessions and hit the site and everything works fine. I wonder if something like this is going on for you.
That’s what I thought as well, but even trying that left any sites using PHP helpless for a while. I’ve been testing and trying to narrow down the culprit, and I’m sad to say I think I may have located it. Granted, I’m still testing to make sure, but I’m afraid this might actually be it. I started disabling certain features one at a time until I didn’t see the hangs anymore, and since disabling this I’ve only seen typical internet hiccups, but no more are my sites completely dying.
OPcache.
I’m going to be quite disappointed if this is it, the speeds and results I got upgrading to PHP 7 were nice, but with OPcache they were so much better. Anyone familiar with this type of issue? Or can you take a look at my OPcache settings and see if I missed something obvious? I’ve omitted comments and only included settings for reference…
[php];extension=php_bz2.dll
extension=php_curl.dll
extension=php_fileinfo.dll
extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
;extension=php_mbstring.dll
;extension=php_exif.dll ; Must be after mbstring as it depends on it
extension=php_mysqli.dll
;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll
;extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
;extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll
zend_extension=php_opcache.dll
opcache.enable=1
;opcache.enable_cli=0
opcache.memory_consumption=192
opcache.interned_strings_buffer=16
opcache.max_accelerated_files=7963
;opcache.max_wasted_percentage=5
;opcache.use_cwd=1
opcache.validate_timestamps=1
opcache.revalidate_freq=0
;opcache.revalidate_path=0
opcache.save_comments=0
opcache.fast_shutdown=1
opcache.enable_file_override=1
;opcache.optimization_level=0xffffffff
;opcache.inherited_hack=1
;opcache.dups_fix=0
;opcache.blacklist_filename=
;opcache.max_file_size=0
;opcache.consistency_checks=0
;opcache.force_restart_timeout=180
;opcache.error_log=
;opcache.log_verbosity_level=1
;opcache.preferred_memory_model=
;opcache.protect_memory=0
;opcache.restrict_api=
;opcache.mmap_base=
;opcache.file_cache=
;opcache.file_cache_only=0
;opcache.file_cache_consistency_checks=1
;opcache.huge_code_pages=0[/php]
It does seem to happen more when I’m building, coding, checking and refreshing pages, if that helps.
I would turn off…
opcache.validate_timestamps=1
change it to
opcache.validate_timestamps=0
I would also uncomment
;opcache.consistency_checks=0
Even after those changes I’m still getting the occasional lockup