Jump to content

Cron Maintenance Tasks Not Running: PHP error


Go to solution Solved by Stuart Silvester,

Recommended Posts

Hi there, my maintenance task cron job is failing. When I try to run it manually on the CLI I get the following error:

# /usr/bin/php -d memory_limit=-1 -d max_execution_time=0 /var/www/html/applications/core/interface/task/task.php 710eec566b32f52cd33c9dfcd1824fdc
PHP Fatal error:  Uncaught Error: Call to undefined function IPS\mb_internal_encoding() in /var/www/html/init.php:556
Stack trace:
#0 /var/www/html/init.php(1583): IPS\IPS::init()
#1 /var/www/html/applications/core/interface/task/task.php(29): require_once('...')
#2 {main}
  thrown in /var/www/html/init.php on line 556

I recently switched servers from an on-prem hardware solution to AWS instances. Everything else works fine, except I now get a giant warning that says my cron jobs are working. 

Help?

Could contain: Text, Paper

Link to comment
Share on other sites

Thank you @Jim M. I must have had an older version of the requirements document. I installed mb_string and restarted Apache. Unfortunately I now get a different '500' error:

# /usr/bin/php -d memory_limit=-1 -d max_execution_time=0 /var/www/html/applications/core/interface/task/task.php 710eec566b32f52cd33c9dfcd1824fdc
<!DOCTYPE html>
<html lang="en">
	<head>
		<title>Error</title>
		<style type='text/css'>
			body {
				background: #f9f9f9;
				margin: 0;
				padding: 30px 20px;
				font-family: "Helvetica Neue", helvetica, arial, sans-serif;
			}

			#error {
				max-width: 800px;
				background: #fff;
				margin: 0 auto;
			}

			h1 {
				background: #151515;
				color: #fff;
				font-size: 22px;
				font-weight: 500;
				padding: 10px;
			}

				h1 span {
					color: #7a7a7a;
					font-size: 14px;
					font-weight: normal;
				}

			#content {
				padding: 20px;
				line-height: 1.6;
			}

			#reload_button {
				background: #151515;
				color: #fff;
				border: 0;
				line-height: 34px;
				padding: 0 15px;
				font-family: "Helvetica Neue", helvetica, arial, sans-serif;
				font-size: 14px;
				border-radius: 3px;
			}
		</style>
	</head>
	<body>
		<div id='error'>
			<h1>An error occurred <span>(500 Error)</span></h1>
			<div id='content'>
				We're sorry, but a temporary technical error has occurred which means we cannot display this site right now.
				<br><br>
								You can try again by clicking the button below, or try again later.
				<br><br>
				<button onclick="window.location.reload();" id='reload_button'>Try again</button>
			</div>
		</div>
	</body>

The Apache logs don't show anything related to that 500 error. Is there a different log I can look at for more info?

Any thoughts?

Thank you

Link to comment
Share on other sites

I found this in the application log:

Wed, 01 Jun 2022 17:58:42 +0000
Error: Class "mysqli" not found (0)
#0 /var/www/html/init.php(735): require_once()
#1 /var/www/html/system/Data/Store/Database.php(92): IPS\IPS::autoloader()
#2 /var/www/html/system/Data/Store/Database.php(108): IPS\Data\Store\_Database->loadIntoMemory()
#3 /var/www/html/system/Data/Store/Database.php(162): IPS\Data\Store\_Database->get()
#4 /var/www/html/system/Data/AbstractData.php(126): IPS\Data\Store\_Database->exists()
#5 /var/www/html/system/Data/Store.php(303): IPS\Data\_AbstractData->__isset()
#6 /var/www/html/system/Settings/Settings.php(176): IPS\Data\_Store->__isset()
#7 /var/www/html/system/Settings/Settings.php(132): IPS\_Settings->loadFromDb()
#8 /var/www/html/applications/core/interface/task/task.php(31): IPS\_Settings->__get()
#9 {main}
#0 /var/www/html/init.php(1015): IPS\_Log::log()
#1 [internal function]: IPS\IPS::exceptionHandler()
#2 {main}

It says it can't find mysqli, but I verified that it is installed for my version of PHP (8.0.19)

# apt-get install php8.0-mysqli
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'php8.0-mysql' instead of 'php8.0-mysqli'
php8.0-mysql is already the newest version (1:8.0.19-1+ubuntu20.04.1+deb.sury.org+1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

 

Link to comment
Share on other sites

Unfortunately, hosting issues are outside our scope of support. You'll want to work with your server administrator to resolve the issue here. Please ensure that the directory which the Invision Community software is in, is the correct PHP version/instance that you're looking at there on your server. 

You'll want to use the requirements checker at the link provided to review these items and work with your server administrator.

Link to comment
Share on other sites

The site is hosted in AWS and I'm the sole administrator with full root access to the LAMP instance. All 3 of the following locations indicate I am using PHP 8.0.19:

phppinfo() page

IPS4.php that you linked to

And my IPS Support page dashboard (screenshot)

Could contain: Page, Text, Word

I can install any package that I need to, but I believe I have them all. 

Kindly asking for guidance from anybody. This appears to be a critical error and I don't want to permanently damage my site. 

 

Link to comment
Share on other sites

2 minutes ago, Stuart Silvester said:

It's possible that you're using a different PHP version/install on command line to the web server. It would be worth checking that /usr/bin/php is the right executable.

Bingo! That was it. Web server was using 8.0.19 and the CLI was using 8.1. I updated the CLI to use 8.0 and the maintenance script ran without error. 

Thank you both @Stuart Silvester and @Jim M

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...