Piwik et php 5.3

Hello,

Sorry for my basic english.

On centos i have updated php. i’m now with php 5.3…
But piwik, not sems to work with php 5.3…

I have this error

Notice: Undefined index: main_url in piwik/core/Site.php

I have tried to update piwik with svn version, but it doesn’t work anymore…

Could you help me please ?

Thanks

I have also an error on a new fresh install :

http://free0.hiboox.com/vignettes/3309/e7184280c75630b48c2628fbf6c495f4.png
Click to enlarge

I don’t understand, i’m the only one who have problem with php 5.3 ?

Try again with Piwik installed in a clean folder. I didn’t see the latter problem with 0.4.3 on php5.3

When i say “I have also an error on a new fresh install :” it’s on a new folder, and new db…

After somes test :

$infoSites[$this->id]

Only contains id, name and a third variable but i don’t remember the name (something like ts_created but with wrong data)

I have also open the Zend_Registry class to see if the record data is correctly set, but it’snt …

Edit : Called On the getSiteFromId in the plugins/SitesManager/API.php file

The sql query work correctly, and i have all the value, but not if i print the data grind directly on the class they don’t…

Can i help you to resolve this issue ?

So, in your piwik_site table, main_url contains a URL of the form: http://yoursite.domain?

[quote=vipsoft @ Aug 14 2009, 08:06 PM) <{POST_SNAPBACK}>[/url]

So, in your piwik_site table, main_url contains a URL of the form: [url=http://yoursite.domain]http://yoursite.domain?

yes…

This is the result of print_r($site) on API.php :

QUOTE
Array ( [idsite] => 1 [name] => SoEz [piwik_site] => 2009-02-20 12:46:18 [piwik] => ]SELECT * FROM piwik_site WHERE idsite =1 idsite name main_url ts_created feedburnerName 1 SoEz [http://www.soez.be](http://www.soez.be) 2009-02-20 12:46:18 NULL[/quote]

The code modified :

        static public function getSiteFromId( $idSite )
        {
                Piwik::checkUserHasViewAccess( $idSite );
                $site = Zend_Registry::get('db')->fetchRow("SELECT * FROM ".Piwik::prefixTable("site")." WHERE idsite = ?", $idSite);
                print_r($site);
                return $site;
        }

I really don’t understand, the prolem seems to come from Zend_Registry, but i also look and found nothing…

If you’re on 64-bit platform, you should downgrade back to php5.2.x as I recall reading about 64-bit compatibilty issues.

I’ll dig into fetchRow when I get back to the office.

Can i do anything else to help you ?

You could try running the test suite…
but you should backup your database first
as you would have to get the tests from svn.

The problem isn’t in Zend_Registry. ZR::get(‘db’) just retrieves the database connection resource. fetchRow is in Zend_Db which we haven’t changed. This leads me to believe this is a portability/build issue in your copy of php5.3.

Can you see if this ticket applies to you?

http://bugs.php.net/bug.php?id=47710

See if the Apache Friends build of XAMPP for Linux works with your Piwik install. If it does, then it would suggest that this is a Centos-specific issue.

http://www.apachefriends.org/en/xampp-linux.html

[quote=vipsoft @ Aug 15 2009, 11:24 AM) <{POST_SNAPBACK}>

You could try running the test suite…

I would like to test, but dev.piwik.org not responding me

QUOTE (vipsoft @ Aug 15 2009, 11:24 AM) [<{POST_SNAPBACK}>](index.php?act=findpost&pid=4369)
The problem isn't in Zend_Registry. ZR::get('db') just retrieves the database connection resource. fetchRow is in Zend_Db which we haven't changed. This leads me to believe this is a portability/build issue in your copy of php5.3.

Like you can see:

http://free0.hiboox.com/images/3309/b55d81604d77551317ebe794a9ff7621.jpg

I have print the result directly on Zend_Db (fetchrow) on file libs/Zend/Db/Adapter/Abstract.php

The only query who have this error was the last one. No error before ( for option …)

QUOTE (vipsoft @ Aug 15 2009, 11:30 AM) [<{POST_SNAPBACK}>](index.php?act=findpost&pid=4370)
Can you see if this ticket applies to you?

http://bugs.php.net/bug.php?id=47710

I don’t thing so, because Dotclear, punbb,phpbb, and other soft like cacti, phpdenora work…
I can use the fetchassoc return value…

QUOTE (vipsoft @ Aug 15 2009, 11:56 AM]See if the Apache Friends build of XAMPP for Linux works with your Piwik install. If it does, then it would suggest that this is a Centos-specific issue.

http://www.apachefriends.org/en/xampp-linux.html[/quote]

I would like to test this only if nothing work before… I have a server where everything is now working perfectly expect piwik…

Many thanks for your help…

Edit :
The query look like this : SELECT * FROM piwik_site WHERE idsite = ? : 2 no error ?

I can test all_tests.php i have the following error :

Some of the tests require a database access. The database used for tests is different from your normal Piwik database. You may need to create this database ; you can edit the settings for the unit tests database access in your config file /config/global.ini.php

The database used in your tests is called “piwik_tests”. Create it if necessary.

The database piwik_tests exist (but is not empty…)
In global.ini.php i have this :

[database_tests]
host = localhost
username = root
password = xxxxxx
dbname = piwik_tests
tables_prefix = piwik_
port = 3306
adapter = PDO_MYSQL

Could you help me for running test ?

This bug? / issue is not yet corrected…

Could you help me please ? I’m not alone…

Set the login credentials in the database_tests section. In phpadmin, create the piwik_tests database.

The other thing to check is that your php upgrade also rebuilt the pdo and pdomysql extensions.