PHP Fatal error: Uncaught TypeError: count(): Argument

Got error ‘PHP message: PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, null given in /home/public_html/lib/fn_core.php:230\nStack trace:\n#0 /home/public_html/lib/fn_core.php(991): core_call_hook()\n#1 /home/public_html/init.php(307): core_themes_get()\n#2 /home/public_html/index.php(19): include(’…’)\n#3 {main}\n thrown in /home/public_html/lib/fn_core.php on line 230’

i have just install playsms 1.4.3 on ubuntu 18, first it was Uncaught Error: Call to undefined function get_magic_quotes_gpc() after fixing that. Please assist

Hi,

That should not happened, because the var in fn_core.php line 230 should be an array and should not be empty.

Would you like to try master version instead ?

git clone https://github.com/playsms/playsms.git
cd playsms
ls -l

installation similar to 1.4.3

anton

I have just finished installing the beta version you have shared and it was success but am getting blank page on browser and the logs do not show much of details

playsmsd has been started
starterd at pid 28862
schedule at pid 28872
ratesmsd at pid 28882
dlrssmsd at pid 28892
sendsmsd at pid 28902
recvsmsd at pid 28912

Checking playSMS daemon status…
playsmsd is running
starterd at pid 28862
schedule at pid 28872
ratesmsd at pid 28882
dlrssmsd at pid 28892
sendsmsd at pid 28902
recvsmsd at pid 28912

playSMS install script finished
Please review installation log above before testing

Logs

    • 2021-03-19 13:26:56 PID6054a69ed86f0 - L3 playsmsd_run # run type:loop command:starterd param: pid:28862
    • 2021-03-19 13:26:56 PID6054a69ed86f0 - L3 playsmsd_run # run type:loop command:schedule param: pid:28872
    • 2021-03-19 13:26:56 PID6054a69ed86f0 - L3 playsmsd_run # run type:loop command:ratesmsd param: pid:28882
    • 2021-03-19 13:26:56 PID6054a69ed86f0 - L3 playsmsd_run # run type:loop command:dlrssmsd param: pid:28892
    • 2021-03-19 13:26:56 PID6054a69ed86f0 - L3 playsmsd_run # run type:loop command:sendsmsd param: pid:28902
    • 2021-03-19 13:26:56 PID6054a69ed86f0 - L3 playsmsd_run # run type:loop command:recvsmsd param: pid:28912

==> httpd-accesss.log <==

    • [19/Mar/2021:13:27:13 +0000] “GET / HTTP/1.1” 500 335 “-” “Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0”

HTTP 500 means theres fatal error somewhere in PHP execution

enable display_errors and error_reporting on php.ini to see actual error
you need to restart your web server and try again
error should be displayed in browser, and in http log

anton

Still unable to run playsms on my ubuntu server,i follow the tutorial one instruction to the next but i keep getting below error any idea
==> httpd-error.log <==
[Sat Apr 10 08:06:04.242129 2021] [proxy_fcgi:error] [pid 2474] [client :6259] AH01071: Got error ‘PHP message: PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, null given in ==> httpd-error.log <==
[Sat Apr 10 08:06:04.242129 2021] [proxy_fcgi:error] [pid 2474] [client :6259] AH01071: Got error ‘PHP message: PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, null given in /home/komodo/public_html/lib/fn_core.php:230\nStack trace:\n#0 /home/komodo/public_html/lib/fn_core.php(991): core_call_hook()\n#1 /home/komodo/public_html/init.php(307): core_themes_get()\n#2 /home/komodo/public_html/index.php(19): include(’…’)\n#3 {main}\n thrown in /home/komodo/public_html/lib/fn_core.php on line 230’
/public_html/lib/fn_core.php:230\nStack trace:\n#0 /home/komodo/public_html/lib/fn_core.php(991): core_call_hook()\n#1 /home/komodo/public_html/init.php(307): core_themes_get()\n#2 /home/komodo/public_html/index.php(19): include(’…’)\n#3 {main}\n thrown in /home/komodo/public_html/lib/fn_core.php on line 230’

Seems the error on below function on the for loop line
for ($c = 0; $c < count($core_config[‘plugins’][‘list’][‘feature’]); $c++)
function core_call_hook($function_name = ‘’, $arguments = array()) {
global $core_config;
$ret = NULL;
if (!$function_name) {
if (PHP_VER >= 50400) {
$f = debug_backtrace(0, 2);

		// PHP 5.4.0 and above
	} else {
		$f = debug_backtrace();
		
		// PHP prior to 5.4.0
	}
	$function_name = $f[1]['function'];
	$arguments = $f[1]['args'];
}
for ($c = 0; $c < count($core_config['plugins']['list']['feature']); $c++) {
	if ($ret = core_hook($core_config['plugins']['list']['feature'][$c], $function_name, $arguments)) {
		break;
	}
}
return $ret;

}

i try to put random number on the count() just out of curiosity and i end up hitting another error
==> httpd-error.log <==
[Sat Apr 10 08:36:35.986094 2021] [proxy_fcgi:error] [pid 3686] [client:6331] AH01071: Got error ‘PHP message: PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in /home/komodo/public_html/lib/composer/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TagTransform/Font.php on line 78’

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.