[Warning] Parameter must be an array | 7.3.7

Problems with the Windows version of XAMPP, questions, comments, and anything related.

[Warning] Parameter must be an array | 7.3.7

Postby amg430lv » 09. August 2019 09:18

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! :)
amg430lv
 
Posts: 2
Joined: 09. August 2019 09:09
XAMPP version: 7.3.7
Operating System: Windows 10

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

Postby Altrea » 09. August 2019 11:17

What is the full path of your XAMPP installation?
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

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

Postby Nobbie » 09. August 2019 11:21

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.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

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

Postby truefriend-cz » 08. May 2020 16:31

I have problem too.

How i can solving this problem?
truefriend-cz
 
Posts: 4
Joined: 08. May 2020 16:16
XAMPP version: 7.4.5
Operating System: Windows

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

Postby Altrea » 08. May 2020 19:17

These three Arrays get filled in \xampp\install\xamppbasic.inc. This file exists in your environment?
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

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

Postby truefriend-cz » 08. May 2020 19:20

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
Last edited by truefriend-cz on 08. May 2020 20:08, edited 1 time in total.
truefriend-cz
 
Posts: 4
Joined: 08. May 2020 16:16
XAMPP version: 7.4.5
Operating System: Windows

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

Postby Altrea » 08. May 2020 19:23

What does this mean exactly? How can i reproduce this issue? Step by Step if possible.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

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

Postby truefriend-cz » 08. May 2020 20:23

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.).
truefriend-cz
 
Posts: 4
Joined: 08. May 2020 16:16
XAMPP version: 7.4.5
Operating System: Windows

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

Postby Altrea » 08. May 2020 21:42

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.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

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

Postby truefriend-cz » 08. May 2020 21:51

Do you have any idea how i can fix this?
truefriend-cz
 
Posts: 4
Joined: 08. May 2020 16:16
XAMPP version: 7.4.5
Operating System: Windows

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

Postby kejo » 03. December 2020 07:55

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
kejo
 
Posts: 4
Joined: 04. June 2019 06:33
XAMPP version: 3.2.3
Operating System: Windows 7 ultimate

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

Postby Nobbie » 03. December 2020 12:34

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.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 154 guests