I installed Moodle 3.11 on my local computer and when I tried to run cron.php today, I got "Error: Database connection failed". What about be the issue? I restarted the server but the below error still exists.
Below is my Terminal when rununing php admin/cli/cron.php,
mike@mike-MacBook-Air moodle311 % php admin/cli/cron.php
PHP Deprecated: Return type of navigation_node_collection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Applications/MAMP/htdocs/moodle311/lib/navigationlib.php on line 1145
Deprecated: Return type of navigation_node_collection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Applications/MAMP/htdocs/moodle311/lib/navigationlib.php on line 1145
PHP Deprecated: Return type of navigation_node_collection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Applications/MAMP/htdocs/moodle311/lib/navigationlib.php on line 1134
Deprecated: Return type of navigation_node_collection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Applications/MAMP/htdocs/moodle311/lib/navigationlib.php on line 1134
PHP Deprecated: Return type of moodle_recordset::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Applications/MAMP/htdocs/moodle311/lib/dml/moodle_recordset.php on line 61
Deprecated: Return type of moodle_recordset::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Applications/MAMP/htdocs/moodle311/lib/dml/moodle_recordset.php on line 61
PHP Deprecated: Return type of context::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Applications/MAMP/htdocs/moodle311/lib/accesslib.php on line 5173
Deprecated: Return type of context::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Applications/MAMP/htdocs/moodle311/lib/accesslib.php on line 5173
PHP Deprecated: Return type of cm_info::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Applications/MAMP/htdocs/moodle311/lib/modinfolib.php on line 1427
Deprecated: Return type of cm_info::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Applications/MAMP/htdocs/moodle311/lib/modinfolib.php on line 1427
PHP Deprecated: Return type of section_info::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Applications/MAMP/htdocs/moodle311/lib/modinfolib.php on line 3018
Deprecated: Return type of section_info::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Applications/MAMP/htdocs/moodle311/lib/modinfolib.php on line 3018
PHP Deprecated: Return type of mysqli_native_moodle_recordset::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Applications/MAMP/htdocs/moodle311/lib/dml/mysqli_native_moodle_recordset.php on line 65
Deprecated: Return type of mysqli_native_moodle_recordset::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Applications/MAMP/htdocs/moodle311/lib/dml/mysqli_native_moodle_recordset.php on line 65
PHP Deprecated: Return type of mysqli_native_moodle_recordset::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Applications/MAMP/htdocs/moodle311/lib/dml/mysqli_native_moodle_recordset.php on line 78
Deprecated: Return type of mysqli_native_moodle_recordset::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Applications/MAMP/htdocs/moodle311/lib/dml/mysqli_native_moodle_recordset.php on line 78
PHP Deprecated: Return type of mysqli_native_moodle_recordset::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Applications/MAMP/htdocs/moodle311/lib/dml/mysqli_native_moodle_recordset.php on line 69
Deprecated: Return type of mysqli_native_moodle_recordset::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Applications/MAMP/htdocs/moodle311/lib/dml/mysqli_native_moodle_recordset.php on line 69
PHP Deprecated: Return type of mysqli_native_moodle_recordset::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Applications/MAMP/htdocs/moodle311/lib/dml/mysqli_native_moodle_recordset.php on line 82
Deprecated: Return type of mysqli_native_moodle_recordset::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Applications/MAMP/htdocs/moodle311/lib/dml/mysqli_native_moodle_recordset.php on line 82
PHP Deprecated: Creation of dynamic property cache_config::$configlockmappings is deprecated in /Applications/MAMP/htdocs/moodle311/cache/classes/config.php on line 146
Deprecated: Creation of dynamic property cache_config::$configlockmappings is deprecated in /Applications/MAMP/htdocs/moodle311/cache/classes/config.php on line 146
PHP Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /Applications/MAMP/htdocs/moodle311/lib/setuplib.php on line 663
Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /Applications/MAMP/htdocs/moodle311/lib/setuplib.php on line 663
PHP Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /Applications/MAMP/htdocs/moodle311/lib/setuplib.php on line 663
Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /Applications/MAMP/htdocs/moodle311/lib/setuplib.php on line 663
PHP Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /Applications/MAMP/htdocs/moodle311/lib/setuplib.php on line 668
Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /Applications/MAMP/htdocs/moodle311/lib/setuplib.php on line 668
!!! <p>Error: Database connection failed</p>
<p>It is possible that the database is overloaded or otherwise not running properly.</p>
<p>The site administrator should also check that the database details have been correctly specified in config.php</p> !!!
mike@mike-MacBook-Air moodle311 %