First of all, thank you very much for having a space for our questions. I’ve been looking for a fix for about a month and I’m running out of time.
Last year I created the site inmobar.com to my digitalocean account, however, over time it was time to pass it on to its owner, so I made another account in Digital Ocean, a snapshot and then created a droplet based on this .
For a long time I thought the problem was due to poor configuration, but by making arrangements and between tickets and queries, I discovered that the site does not have problems with HTML files such as https://inmobar.com/readme.html; instead, you show problems loading the home page or any page with content.
I have found references to other migration errors regarding NGINX permalinks, I have also had experience with caching problems but none of these cases fit my case because it does not have a caching system and the NGINX configuration already worked in the previous machine and this is a copy.
So I was wondering if WordPress has a history of showing these problems, I usually use a plugin to migrate from one machine to another but I’m using a database on a cluster so said helper plugin didn’t allow me to go down that route.
I will appreciate your help to save this site before it is canceled.
]]>I’m using Apache but my current PHP version runs as php-fpm and I guess that’s the reason, why WordPress is showing me in my permalinks configuration on /wp-admin/options-permalink.php
links like:
https://contoso.com/index.php/2023/11/28/example-post/
So including “index.php”, which I really don’t need.
I figured out that’s because got_url_rewrite() | Function | WordPress Developer Resources returns false in this case, and that’s because apache_mod_loaded() | Function | WordPress Developer Resources returns false (detects not apache).
How do you deal with this issue? How can I tell WordPress, that my php-fpm based website has mod_rewrite in fact and I don’t need this “index.php” in the permalinks?
Thank you in advance
]]>My first try was to spin up a new temporary install with 6.0.5, do the relevant updates to 6.3.1, export and reimport. I didn’t realize at that point that PHP8.2 was not compatible with 6.0.5, so my colleague spun up a 6.0.5/PHP7.4/Apache instance where we were successful in doing all the updates. We exported and reimported on to the destination box and are having problems with the nginx/php-fpm combination.
In my error log I am getting lines like:
2023/10/03 03:06:35 [error] 108449#108449: *3 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: XX.XX.XX.XX, server: finquesbahiamar.cat, request: "GET /info.php HTTP/2.0", upstream: "fastcgi://unix:/run/php/php8.2-fpm.sock:", host: "finquesbahiamar.cat"
and the browser is displaying “File not found”.
The following is from the nginx config:
upstream php-handler {
# server 127.0.0.1:9000;
server unix:/run/php/php8.2-fpm.sock;
}
And
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
The permissions are correct as far as I can work out:
root@edisford:~# ls -al /run/php/
total 4
drwxr-xr-x 2 www-data www-data 100 Oct 3 03:04 .
drwxr-xr-x 24 root root 800 Oct 3 03:04 ..
-rw-r--r-- 1 root root 6 Oct 3 03:04 php8.2-fpm.pid
srw-rw---- 1 www-data www-data 0 Oct 3 03:04 php8.2-fpm.sock
lrwxrwxrwx 1 root root 30 Oct 2 23:19 php-fpm.sock -> /etc/alternatives/php-fpm.sock
I am getting wooden splinters in my fingernails from scratching my head and guidance would be appreciated. Thank you in advance.
]]>I hosted a WordPress site on AWS Lightsail last year, and for the past year, it has been working fine. However, starting from last month, the site has been going down multiple times a day. Each time it shows an ‘HTTP Error 503 Service Unavailable.’ When we check the instance, the CPU usage is high. After rebooting the instance, it works fine again. I’m not sure what is causing this issue.
Below you can find error logs
Mon Jul 10 05:45:54.595799 2023] [authz_core:error] [pid 846:tid 139813910988544] [client 44.210.245.139:45196] AH01630: client denied by server configuration: /opt/bitnami/wordpress/.htaccess
[Mon Jul 10 05:45:54.609416 2023] [authz_core:error] [pid 834:tid 139814481299200] [client 44.210.245.139:45222] AH01630: client denied by server configuration: /opt/bitnami/wordpress/.htaccess.BAK
[Mon Jul 10 05:46:00.963884 2023] [authz_core:error] [pid 834:tid 139814296659712] [client 44.210.245.139:45896] AH01630: client denied by server configuration: /opt/bitnami/wordpress/.user.ini
[Mon Jul 10 06:44:47.286502 2023] [autoindex:error] [pid 835:tid 139814464513792] [client 20.253.242.138:56423] AH01276: Cannot serve directory /opt/bitnami/wordpress/wp-admin/css/: No matching DirectoryIndex (index.html,index.html,index.htm,index.php) found, and server-generated directory index forbidden by Options directive, referer: binance.com
[Mon Jul 10 07:48:02.326708 2023] [mpm_event:notice] [pid 827:tid 139815391861632] AH00493: SIGUSR1 received. Doing graceful restart
[Mon Jul 10 07:48:02.385702 2023] [ssl:warn] [pid 827:tid 139815391861632] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Mon Jul 10 07:48:02.387405 2023] [mpm_event:notice] [pid 827:tid 139815391861632] AH00489: Apache/2.4.53 (Unix) OpenSSL/1.1.1n configured — resuming normal operations
[Mon Jul 10 07:48:02.387422 2023] [core:notice] [pid 827:tid 139815391861632] AH00094: Command line: ‘/opt/bitnami/apache/bin/httpd -f /opt/bitnami/apache/conf/httpd.conf’
[Mon Jul 10 08:17:03.383429 2023] [autoindex:error] [pid 13690:tid 139814598797056] [client 157.230.32.156:51185] AH01276: Cannot serve directory /opt/bitnami/wordpress/wp-admin/css/: No matching DirectoryIndex (index.html,index.html,index.htm,index.php) found, and server-generated directory index forbidden by Options directive, referer: binance.com
[Mon Jul 10 09:55:24.942661 2023] [proxy_fcgi:error] [pid 13951:tid 139814254696192] [client 52.4.52.157:45538] AH01071: Got error ‘PHP message: PHP Fatal error: Out of memory (allocated 29360128) (tried to allocate 20480 bytes) in /bitnami/wordpress/wp-content/plugins/woocommerce/src/Internal/Traits/AccessiblePrivateMethods.php on line 158PHP message: PHP Fatal error: Out of memory (allocated 29360128) (tried to allocate 20480 bytes) in /bitnami/wordpress/wp-content/plugins/webp-converter-for-media/vendor/composer/ClassLoader.php on line 582’
[Mon Jul 10 09:55:43.549362 2023] [proxy_fcgi:error] [pid 12915:tid 139814682724096] [client 196.6.208.24:53355] AH01071: Got error ‘PHP message: PHP Fatal error: Out of memory (allocated 31457280) (tried to allocate 20480 bytes) in /opt/bitnami/wordpress/wp-includes/functions.php on line 4811PHP message: PHP Fatal error: Out of memory (allocated 31457280) (tried to allocate 20480 bytes) in /opt/bitnami/wordpress/wp-includes/class-wp-hook.php on line 301’, referer: https://www.encryptionconsulting.com/what-is-the-certificate-chain-of-trust
[Mon Jul 10 09:55:50.621701 2023] [proxy_fcgi:error] [pid 13951:tid 139814430942976] [client 86.6.184.78:53507] AH01071: Got error ‘PHP message: PHP Fatal error: Out of memory (allocated 29360128) (tried to allocate 327680 bytes) in /bitnami/wordpress/wp-content/plugins/wp-rocket/inc/Engine/Optimization/Minify/CSS/Minify.php on line 215’, referer: https://www.google.com/
[Mon Jul 10 09:55:50.676625 2023] [proxy_fcgi:error] [pid 13951:tid 139814430942976] [client 86.6.184.78:53507] AH01071: Got error ‘PHP message: PHP Fatal error: Unknown: Cannot use output buffering in output buffering display handlers in Unknown on line 0’, referer: https://www.google.com/
[Mon Jul 10 09:58:34.774690 2023] [proxy_fcgi:error] [pid 13689:tid 139814380586752] [client 52.4.52.157:33354] AH01071: Got error ‘PHP message: PHP Fatal error: Out of memory (allocated 31457280) (tried to allocate 20480 bytes) in /opt/bitnami/wordpress/wp-includes/rest-api/class-wp-rest-server.php on line 907PHP message: PHP Fatal error: Out of memory (allocated 31457280) (tried to allocate 20480 bytes) in /bitnami/wordpress/wp-content/plugins/wordpress-seo/src/models/indexable.php on line 0’
[Mon Jul 10 09:58:50.702992 2023] [proxy_fcgi:error] [pid 12904:tid 139814380586752] [client 122.174.254.245:37181] AH01071: Got error ‘PHP message: WordPress database error Commands out of sync; you can’t run this command now for query SELECT COUNT(*) FROM wp_bv_fw_requests; made by BVFW->log, BVLogger->log, MCWPDb->rowsCount, MCWPDb->getVarPHP message: WordPress database error Commands out of sync; you can’t run this command now for query SHOW FULL COLUMNS FROM wp_bv_fw_requests
made by BVFW->log, BVLogger->log, MCWPDb->replaceIntoBVTable’, referer: https://www.google.com/
Additionally, I modified the php.ini file to increase the memory_limit to 1024M.
I am sorry, this is my first question, I don’t know, what is causing the issue, so I pasted all error_logs
Could you please assist me in identifying the cause of these issues and provide steps to resolve them?
]]>Showing below error on browser –
There has been a critical error on this website. Please check your site admin email inbox for instructions.
And below is the error log in my server-
FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Function name must be a string in /var/www/html/public_html/wp-content/plugins/insert-headers-and-footers/includes/generator/class-wpcode-generator-query.php:1
Stack trace:
#0 /var/www/html/public_html/wp-content/plugins/insert-headers-and-footers/includes/class-wpcode-generator.php(52): require_once()
#1 /var/www/html/public_html/wp-content/plugins/insert-headers-and-footers/includes/class-wpcode-generator.php(31): WPCode_Generator->load_types()
#2 /var/www/html/public_html/wp-content/plugins/insert-headers-and-footers/ihaf.php(259): WPCode_Generator->__construct()
#3 /var/www/html/public_html/wp-content/plugins/insert-headers-and-footers/ihaf.php(161): WPCode->load_components()
#4 /var/www/html/public_html/wp-content/plugins/insert-headers-and-footers/ihaf.php(149): WPCode->__construct()
#5 /var/www/html/public_html/wp-content/plugins/insert-headers-and-footers/ihaf.php(285): WPCode::instance()
#6 /var/www/html/public_html/wp-content/plugins/insert-" while reading response header from upstream, client: redacted, server: *.redacted.com, request: "POST /wp-admin/admin-ajax.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.4-fpm.sock:", host: "redacted.com", referrer: "https://redacted/wp-admin/index.php"
]]>auto_prepend_file /correct/path/to/wordfence-waf.php
indicating that the prepend is being processed correctly, but the diagnostics pages in wordpress shows;
WAF auto prepend active No
Any ideas where to go from here ? Using apache2 and php7.4-fpm
Thanks!
]]>My problem:
on my webserver I see many “php-fpm” processes running ~50 processes at a time.
(Traffic is also high)
When i load a page on my website the page seems to be loaded from WP Super Cache path.
(I add a Header after “try_files” and the site source code has the WP Super Cache Comment at the end of the page)
My Questions:
Why are there many php-fpm processes?
(In my opinion everything should be loaded immediately from cache and therefore not many processes should be running)
Is the problem with WP Super Cache settings, nginx setting or something else?
Also i am not a professional and i am learning by doing.
Server: VPS, RAM 64 GB, 8 cores (Server itself should not be problem i think)
I am also using plesk
My nginx config looks like this:
#Permalink fix für Nginx Only + Check in cache for entry
# WP Super Cache rules.
# Designed to be included from a 'wordpress-ms-...' configuration file.
set $cache_uri $request_uri;
# POST requests and urls with a query string should always go to PHP
if ($request_method = POST) {
set $cache_uri 'null cache';
}
if ($query_string != "") {
set $cache_uri 'null cache';
}
# Don't cache uris containing the following segments
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
set $cache_uri 'null cache';
}
# Don't use the cache for logged in users or recent commenters
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") {
set $cache_uri 'null cache';
}
location / {
gzip on;
gzip_http_version 1.0;
gzip_vary on;
gzip_comp_level 3;
gzip_proxied any;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_buffers 16 8k;
#try_files /wp-content/cache/supercache/${http_host}${request_uri}index-https.html $uri $uri/ /index.php?$args;
try_files /wp-content/cache/supercache/${http_host}${cache_uri}index-https.html $uri $uri/ /index.php?$args;
#try_files "/wp-content/cache/supercache/$http_host/$request_uri/index-https.html" $uri $uri/ /index.php?$args;
add_header "X-Cache" "HIT - WP Super Cache";
}
pagespeed on;
pagespeed FileCachePath "/var/cache/pagespeed/";
pagespeed FileCacheSizeKb 1638400;
pagespeed FileCacheCleanIntervalMs 172800000;
pagespeed FileCacheInodeLimit 500000;
pagespeed Domain *.blackout-news.de;
pagespeed Domain https://blackout-news.de;
pagespeed Domain https://blackout-news.de;
pagespeed Disallow "*/wp-admin/*";
pagespeed Disallow "*/tinymce/*";
pagespeed Disallow "*/mysql/*";
pagespeed Statistics on;
pagespeed StatisticsLogging on;
pagespeed LogDir /var/log/pagespeed;
pagespeed StatisticsLoggingIntervalMs 60000;
pagespeed StatisticsLoggingMaxFileSizeKb 1024;
location /ngx_pagespeed_statistics {
allow xxx;
deny all;
}
location /ngx_pagespeed_message {
allow xxx;
deny all;
}
location /pagespeed_console {
allow xxx;
deny all;
}
location ~ ^/pagespeed_admin {
allow xxx;
deny all;
}
pagespeed StatisticsPath /ngx_pagespeed_statistics;
pagespeed MessagesPath /ngx_pagespeed_message;
pagespeed ConsolePath /pagespeed_console;
pagespeed AdminPath /pagespeed_admin;
pagespeed LoadFromFile "https://blackout-news.de/wp-content/" "/var/www/vhosts/blackout-news.de/httpdocs/wp-content/";
pagespeed LoadFromFile "https://blackout-news.de/wp-content/" "/var/www/vhosts/blackout-news.de/httpdocs/wp-content/";
pagespeed LoadFromFile "https://blackout-news.de/wp-includes/" "/var/www/vhosts/blackout-news.de/httpdocs/wp-includes/";
pagespeed LoadFromFile "https://blackout-news.de/wp-includes/" "/var/www/vhosts/blackout-news.de/httpdocs/wp-includes/";
pagespeed MemcachedServers "localhost:11211";
pagespeed MemcachedTimeoutUs 1000000;
pagespeed RewriteLevel CoreFilters;
pagespeed CriticalImagesBeaconEnabled false;
pagespeed DisableFilters lazyload_images;
pagespeed DisableFilters inline_preview_images;
pagespeed DisableFilters inline_images;
pagespeed DisableFilters prioritize_critical_css;
pagespeed SlowFileLatencyUs 500000;
location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
add_header "" "";
}
location ~ "^/pagespeed_static/" { }
location ~ "^/ngx_pagespeed_beacon$" { }
#Browser Cache
location ~* \.(webp|js|jpg|jpeg|gif|png|css|tgz|gz|rar|bz2|doc|pdf|ppt|tar|wav|bmp|rtf|swf|ico|flv|txt|woff|woff2|svg)$ {
expires 30d;
add_header Pragma "public";
add_header Cache-Control "public";
}
location = /xmlrpc.php {
deny all;
}
]]>4367#0: *860405 FastCGI sent in stderr: "PHP message: WordPress database error Deadlock found when trying to get lock; try restarting transaction for query INSERT INTO
options(
option_name,
option_value,
autoload) VALUES ('_transient_timeout_jpp_li_49d04df55aff9f4e2bcad823ad1207c6', '1646928926', 'no') ON DUPLICATE KEY UPDATE
option_name= VALUES(
option_name),
option_value= VALUES(
option_value),
autoload= VALUES(
autoload) made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/madara/madara-core/manga-single-reading.php'), get_footer, locate_template, load_template, require_once('/themes/madara/footer.php'), wp_footer, do_action('wp_footer'), WP_Hook->do_action, WP_Hook->apply_filters, WP_MANGA_LOGIN->login_template, WP_MANGA_TEMPLATE->load_template, include('/themes/madara/madara-core/login.php'), do_action('login_form'), WP_Hook->do_action, WP_Hook->apply_filters, Jetpack_Protect_Module->check_login_ability, Jetpack_Protect_Module->pro" while reading upstream
Few of this error appears with different “VALUES” and after that this start to pop:
4368#0: *851348 connect() to unix:/var/www/vhosts/system/php-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream
And the site becomes unreachable until I restart.
What can I do to fix this problem?
Thanks.
]]>I remember when I first install WordFence, there is a setup dialog which asks me for settings such as PHP handler. At that time, my domain uses suPHP so I select that option.
Today I switch PHP handler from suPHP to PHP-FPM, and I just recall that setup. So I just wonder need I do something in WordFence settings, options or configuration files so to be consistent with the new PHP handler setting PHP-FPM?
Thank you
]]>