Comments (3)
About the error: == PHP Warning: Invalid argument supplied for foreach () in /var/www/html/wp-cron.php
==
I found a solution on a Wordpress forum. I´m not a developer, so I don't know if this solution has any harmful effect.
I am testing, monitoring, and waiting for some negative response when changing the WP-CRON.php code
-Is a wp bug, line 117 of wp-cron.php reads: foreach ( $cronhooks as $hook => $keys ) {
-this should read: if ( $cronhooks ) foreach ( $cronhooks as $hook => $keys ) {
or: if ( is_array( $cronhooks ) ) foreach ( $cronhooks as $hook => $keys ) {
-this will prevent warning messages like: [Fri Aug 28 21:15:16.443167 2020] [fcgid:warn] [pid 62430] [client 77.68.64.25:32953] mod_fcgid: stderr: PHP Warning: Invalid argument supplied for foreach() in /home/domains/vol3/578/2510578/user/htdocs/wp-cron.php on line 117, referer: https://www.pakohl.com/wp-cron.php?doing_wp_cron=1598645713.5858569145202636718750
-when $cronhooks
is false
The solution was obtained by Jacob N. Breetvelt (@opajaap) in the following topic of the Wordpress.org support:
https://wordpress.org/support/topic/cron-errors-3/
Hope it works for you too.
from slickstack.
Thanks for sharing @unstatusthequo
I have seen this on some SlickStack sites and not others, immediately after setup is complete. I'm not sure but it's probably caused by one of our default MU plugins.
There are a few relevant threads on this issue:
https://wordpress.org/support/topic/wp-cron-php-problem/
Since I'm not sure what is causing it, I'm not sure what the fix would be yet, so we'll leave this Issue open for now and welcome new input on this. In any case, it is not a critical error.
from slickstack.
Thanks very much for sharing that @EdTrojas and apologies for the long delay.
Here's a few other relevant threads now:
Ref: https://wordpress.org/support/topic/wp-cron-php-problem/
Ref: https://wordpress.org/support/topic/invalid-argument-supplied-for-foreach-157/
Ref: https://wordpress.org/support/topic/cron-errors-3/
Ref: https://wordpress.org/support/topic/warning-with-wp-cron/
Also this comment seems relevant, in regard to plugins causing this, although I'm not sure it's accurate for all cases:
@autotutorial
3 years, 1 month ago
Hello @lukeau, the problem is that $ crons is created with the first parameter as a boolean value. I’m sure the text won’t be investigative. This error, theme, plugin or core WordPress :/ obviously the cron is retrieved from the database, maybe that fake means not to run any cron? Currently I can’t answer. ...
TLDR I think this was probably caused by one of our MU plugins previously, some of which haven't been updated in a while and have some rather complex coding style that we will be abandoning in the future.
Since we have since removed several MU plugins from our default installation, and since this doesn't seem to be directly caused by SlickStack, I'm going to close this Issue for now.
If any further feedback on this feel free to comment here or on the repos of our various plugins --
from slickstack.
Related Issues (20)
- Website very slow loading inside apps ios HOT 3
- CERT_AUTHORITY_INVALID After install HOT 1
- SUDO_USER and SFTP_USER validation check to avoid conflicts? HOT 2
- Perform custom tasks during certain SlickStack scripts HOT 1
- Invalid user mysql:mysql error when using remote database HOT 1
- Ensure more privacy for openssl cert generation. HOT 11
- SS_ADMINER_PUBLIC="false" does not work as intended. HOT 9
- Allow tuning of PHP8 JIT settings (opcache.jit options in php.ini) HOT 4
- Cloudflare real visitor IP support in Nginx config HOT 18
- Option to allow only Cloudflare IPs to connect to origin server HOT 2
- OpenVZ PHP-FPM "Unable to set priority for the master process: Permission denied" HOT 9
- Support for custom Permissions Policy HTTP header in Nginx HOT 6
- Improve WP-Cron robustness for Multisite environments HOT 3
- Scanning WordPress core files to check if intact or broken HOT 4
- Redirect .php extension to WordPress if not exists HOT 4
- Why deny /wp-admin/load-styles.php and /wp-admin/load-scripts.php? HOT 3
- Nginx access log enabled by default but nginx.conf says not HOT 5
- Spam Content HOT 1
- Expose additional options for ss remote backup HOT 2
- support for local development ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slickstack.