Invalid argument supplied for foreach()

(richc) #1

I am trying to install piwik to but every time I run the install it get errors. Always the same errors and I have tried to install several times. Each time deleting all files and folders including the piwik folder on the root directory then navigating to The errors are as follows:
Invalid argument supplied for foreach()
in ‘/mnt/glusterfs/apache/hosting-dir/25240/38358/piwik/core/Config.php’ at the line 248

#0 Piwik_ErrorHandler(2, Invalid argument supplied for foreach(), /mnt/glusterfs/apache/hosting-dir/25240/38358/piwik/core/Config.php, 248, Array ([allSections] => Array ())) called at [/mnt/glusterfs/apache/hosting-dir/25240/38358/piwik/core/Config.php:248]
#1 Piwik_Config->cacheConfigArray() called at [/mnt/glusterfs/apache/hosting-dir/25240/38358/piwik/core/Config.php:292]
#2 Piwik_Config->__get(Plugins) called at [/mnt/glusterfs/apache/hosting-dir/25240/38358/piwik/core/FrontController.php:209]
#3 Piwik_FrontController->init() called at [/mnt/glusterfs/apache/hosting-dir/25240/38358/piwik/index.php:103]

just deleted all files and tried to install piwik 0.4.5
SAME results
ANY help is greatly appreciated

(vipsoft) #2

What version of php?

Can you make sure piwik/config/global.ini.php exists, is readable, intact, etc?

(richc) #3

[quote=vipsoft @ Dec 26 2009, 03:11 PM]What version of php?

Can you make sure piwik/config/global.ini.php exists, is readable, intact, etc?[/quote]

PHP is version 5.2.6

piwik/config/global.ini.php seems to be fine.

(vipsoft) #4

Thanks. In 0.5.5, the Installer will now flag a missing parse_ini_file() as a critical error.

(richc) #5

Is there a workaround for this? I am currently using phpmyvisites but it only gives me country level locating. we are a regional company and really need to get location information down to the city level. I have yet to figure out how to get phpmyvisites to do this. Another option would be if I could figure how phpmyvisites is storing the ip addresses in the database I can use another script to work out the city information based on the ip. But it doesn’t seem to store IP addresses in a normal format.
Thank you for your help so far. Any further help is GREATLY appreciated.

(vipsoft) #6

A workaround does not currently exist. I’m not even sure what the performance impact would be for a pure-PHP version of parse_ini_file vs the built-in function, especially when parse_ini_file() is also used by the tracker.

(vipsoft) #7

Ok. There is a workaround but the code is being held hostage…

Some quick factoids:

The pure PHP implementation is 1/3 the speed of the built-in function (56 ms vs 18 ms) – that includes I/O – and has a bigger memory footprint (62K vs 13K). This would obviously have an impact on tracker performance. (All measurements are approximate and may vary depending on your PHP version.)

(vipsoft) #8

Ok, having sorted out a licensing issue with some contributed code, the fix is now in svn.

(Gerhard) #9

I have a server with 5.3.0 with Piwik which works perfectly. Bu i also have a server using PHP 5.1.6 with Piwik 0.5.4 and have the same problem.

Is there any solution or workaround for it?

(vipsoft) #10

Gerhard: this was fixed shortly after the 0.5.4 release. It’ll be included in the next Piwik relese.