• Resolved benja1

    (@benja1)


    Hi,

    Error Details
    =============
    An error of type E_ERROR was caused in line 548 of the file /var/www/html/a-c-d.net/public_html/wp-content/plugins/amp/src/Admin/SiteHealth.php. Error message: Uncaught TypeError: preg_match(): Argument #2 ($subject) must be of type string, array given in /var/www/html/a-c-d.net/public_html/wp-content/plugins/amp/src/Admin/SiteHealth.php:548
    Stack trace:
    #0 /var/www/html/a-c-d.net/public_html/wp-content/plugins/amp/src/Admin/SiteHealth.php(548): preg_match()
    #1 /var/www/html/a-c-d.net/public_html/wp-content/plugins/amp/src/Admin/SiteHealth.php(634): AmpProject\AmpWP\Admin\SiteHealth::AmpProject\AmpWP\Admin\{closure}()
    #2 /var/www/html/a-c-d.net/public_html/wp-content/plugins/amp/src/Admin/SiteHealth.php(491): AmpProject\AmpWP\Admin\SiteHealth->check_for_page_caching()
    #3 /var/www/html/a-c-d.net/public_html/wp-content/plugins/amp/src/Admin/OptionsMenu.php(230): AmpProject\AmpWP\Admin\SiteHealth->get_page_cache_detail()
    #4 /var/www/html/a-c-d.net/public_html/wp-includes/class-wp-hook.php(307): AmpProject\AmpWP\Admin\OptionsMenu->enqueue_assets()
    #5 /var/www/html/a-c-d.net/public_html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #6 /var/www/html/a-c-d.net/public_html/wp-includes/plugin.php(474): WP_Hook->do_action()
    #7 /var/www/html/a-c-d.net/public_html/wp-admin/admin-header.php(118): do_action()
    #8 /var/www/html/a-c-d.net/public_html/wp-admin/admin.php(239): require_once(‘…’)
    #9 {main}
    thrown

    Thanks

    Ben

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hello @benja1,

    Thank you for the support topic, can you please send your site health information using this form so we can further debug the issue.

    Thread Starter benja1

    (@benja1)

    Hi,

    Thanks for fast reply.

    The document is filled, thanks!

    Thread Starter benja1

    (@benja1)

    Feb 24 15:30:11 a-c-d php-fpm8.1[199692]: [24-Feb-2022 15:30:11] ALERT: [pool php-fpm-pool-settings] user has not been defined
    Feb 24 15:30:11 a-c-d php-fpm8.1[199692]: [24-Feb-2022 15:30:11] ERROR: failed to post process the configuration
    Feb 24 15:30:11 a-c-d php-fpm8.1[199692]: [24-Feb-2022 15:30:11] ERROR: FPM initialization failed
    Feb 24 15:30:11 a-c-d systemd[1]: php8.1-fpm.service: Main process exited, code=exited, status=78/CONFIG
    Feb 24 15:30:11 a-c-d systemd[1]: php8.1-fpm.service: Failed with result ‘exit-code’.
    Feb 24 15:30:11 a-c-d systemd[1]: Failed to start The PHP 8.1 FastCGI Process Manager

    Thread Starter benja1

    (@benja1)

    Hi,

    i solved the issue by uncommeting pm.max_requests = 500 in /etc/php/8.1/fpm/pool.d/www.conf from the last answer in this question.

    Thanks!

    Thread Starter benja1

    (@benja1)

    Too fast, the error is still there

    Thread Starter benja1

    (@benja1)

    AMP is up and running but it slowes down my site on mobile.

    Plugin Author Weston Ruter

    (@westonruter)

    I can see the cause for the fatal error. It’s due to your web server returning duplicate headers which is causing wp_remote_retrieve_header() to return an array instead of a string.

    I’ve filed an issue to fix: https://github.com/ampproject/amp-wp/issues/6937

    I’ve also opened a pull request to fix: https://github.com/ampproject/amp-wp/pull/6938

    If you apply the changes to your src/Admin/SiteHealth.php file it should eliminate this fatal error.

    Thank you for reporting.

    Plugin Author Weston Ruter

    (@westonruter)

    Alternatively, you could try to avoid the duplicate headers being sent. When accessing your homepage, the response headers I get are:

    cache-control: no-cache
    wpo-cache-status: cached
    strict-transport-security: max-age=31536000
    content-security-policy: upgrade-insecure-requests
    x-content-type-options: nosniff
    x-xss-protection: 1; mode=block
    expect-ct: max-age=7776000, enforce
    referrer-policy: no-referrer-when-downgrade
    permissions-policy:
    x-frame-options: SAMEORIGIN
    last-modified: Thu, 24 Feb 2022 21:22:44 GMT
    cache-control: max-age=600
    expires: Thu, 24 Feb 2022 21:33:20 GMT
    vary: Accept-Encoding,User-Agent
    content-type: text/html; charset=UTF-8
    date: Thu, 24 Feb 2022 21:23:20 GMT
    server: Apache/2.4.52 (Ubuntu)

    Notice the duplicate cache-control headers.

    As we didn’t receive a response I’ll mark this as resolved. Feel free to open a new support topic if you require any further assistance.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘AMP plugin breaks my site’ is closed to new replies.