Page 1 of 1

[Warning] Parameter must be an array | 7.3.7

PostPosted: 09. August 2019 09:18
by amg430lv
Hi, all. Installed Xampp 7.3.7 on Windows and don't see XAMPP Control Panel in start menu, ok so i go in xampp directory and run xampp_setup.bat, and get warnings

Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\install\install.php on line 311
Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\install\install.php on line 312
Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\install\install.php on line 313


Code: Select all
311: $scount = count($slashrootreal);
312: $bcount = count($backslashrootreal);
313: $dbcount = count($doublebackslashrootreal);


Thank, you! :)

Re: [Warning] Parameter must be an array | 7.3.7

PostPosted: 09. August 2019 11:17
by Altrea
What is the full path of your XAMPP installation?

Re: [Warning] Parameter must be an array | 7.3.7

PostPosted: 09. August 2019 11:21
by Nobbie
Altrea wrote:What is the full path of your XAMPP installation?


See above

Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\install\install.php on line 311


See its either c:\xampp or c:\xampp\install - i dont have Windows to check it.

Re: [Warning] Parameter must be an array | 7.3.7

PostPosted: 08. May 2020 16:31
by truefriend-cz
I have problem too.

How i can solving this problem?

Re: [Warning] Parameter must be an array | 7.3.7

PostPosted: 08. May 2020 19:17
by Altrea
These three Arrays get filled in \xampp\install\xamppbasic.inc. This file exists in your environment?

Re: [Warning] Parameter must be an array | 7.3.7

PostPosted: 08. May 2020 19:20
by truefriend-cz
Yes. It is exist.

I would just like to add that this problem occurs if XAMPP is already running a second time and more than twice. The first time running XAMPP, this error does not appear.
I using portbale version

Re: [Warning] Parameter must be an array | 7.3.7

PostPosted: 08. May 2020 19:23
by Altrea
What does this mean exactly? How can i reproduce this issue? Step by Step if possible.

Re: [Warning] Parameter must be an array | 7.3.7

PostPosted: 08. May 2020 20:23
by truefriend-cz
After running: setup_xampp.bat

It works ok: When I unpack the portable version and run it for the first time.
Then I'll end it ...
It displays the following error: when I start XAMPP faulty (quit), third (and quit), fourth (and quit), etc.

I using portable version and this is my scripts for running/ending:

Running script:
Code: Select all
@echo off
start "TEMP" call setup_xampp.bat
start "TEMP" xampp-control.exe
%windir%\system32\ping.exe 127.0.0.1 -n 5 >nul 1>nul 2>nul
set "container=notepad.exe,cmd.exe"
for %%i in (%container%) do (
   for /f "tokens=2 delims=," %%a in ('tasklist /fi "imagename eq %%i" /v /fo:csv /nh ^| findstr /r "TEMP"') do taskkill /pid %%a
)


... To keep the command line windows open, I will name them "TEMP" and then kill them.

Exit script:
Code: Select all
@echo off
for %%f in ("*stop*.bat") do (
   echo %%f|findstr /i "apache mysql" >nul
   if not errorlevel 1 (
      start "TEMP" /min call %%f
   )
)
%windir%\system32\ping.exe 127.0.0.1 -n 5 >nul 1>nul 2>nul
set "container=notepad.exe,cmd.exe"
for %%i in (%container%) do (
   for /f "tokens=2 delims=," %%a in ('tasklist /fi "imagename eq %%i" /v /fo:csv /nh ^| findstr /r "TEMP"') do taskkill /pid %%a
)

start "" ".\apache\bin\pv.exe" -f -k httpd.exe -q
start "" ".\apache\bin\pv.exe" -f -k mysqld.exe -q

%windir%\system32\taskkill.exe /im "httpd.exe" /f>nul 1>nul 2>nul
%windir%\system32\taskkill.exe /im "mysqld.exe" /f>nul 1>nul 2>nul

%windir%\system32\taskkill.exe /im "conhost.exe" /f>nul 1>nul 2>nul


... Sometimes not all services end as they should, so I defined it in three different ways.

And xampp-control.ini have add:
Code: Select all
[Autostart]
Apache=1
MySQL=1
FileZilla=0
Mercury=0
Tomcat=0


... for automatically start Apache and MySQL (Because I have a portable version, I don't want to install and running as services.).

Re: [Warning] Parameter must be an array | 7.3.7

PostPosted: 08. May 2020 21:42
by Altrea
Thank you very much for the explanation.

Yes, executing setup_xampp.bat once is needed if you use the zipped versions and don't extract the xampp folder on root of a hard drive. Otherwise the paths will not match and produce weird issues like this one.

Re: [Warning] Parameter must be an array | 7.3.7

PostPosted: 08. May 2020 21:51
by truefriend-cz
Do you have any idea how i can fix this?

Re: [Warning] Parameter must be an array | 7.3.7

PostPosted: 03. December 2020 07:55
by kejo
Hello,
I have upgraded to php version 7.4.10. I am now getting an error on all my uses of count(). An example of one of my errors is:

Fatal error: Uncaught Error: Call to a member function count() on bool in C:\xampp\htdocs\website\classes\validate.php:41

Is there a fix for this problem?

Thanks

Re: [Warning] Parameter must be an array | 7.3.7

PostPosted: 03. December 2020 12:34
by Nobbie
The problem is not the count() method, the problem is that you have an invalid class member which calls count(). The error message says, that you are running count() on a bool value, that means, the your class member is invalid, it does not contain a class structure, but instead a boolean value (probably the value FALSE).

That is usually the case when something wents wrong before calling count(), i.e. a database connection fails or similar and your code does not handle that error correctly, instead it assigns FALSE to the class member. There is nothing with PHP or Xampp, there is something wrong in your infrastructure (data missing or users missing or so) and there is no error handling.

Why did you "upgrade" your installation, did anything went wrong? NEVER UPDATE A RUNNING SYSTEM WITHOUT NEEDS.