gallery2 installation fails

Bug #569865 reported by Teun Vink
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
php5 (Debian)
Fix Committed
Unknown
php5 (Ubuntu)
Confirmed
High
Unassigned
Lucid
Confirmed
High
Unassigned

Bug Description

Binary package hint: gallery2

Step 8 of the gallery2 web installation fails due to deprecation errors:

Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/gallery2/modules/core/classes/GalleryStorage.class on line 290 Deprecated: Function ereg() is deprecated in /usr/share/gallery2/modules/core/classes/GalleryStorage.class on line 1120 Deprecated: Function ereg() is deprecated in /usr/share/gallery2/modules/core/classes/GalleryStorage.class on line 1120 Deprecated: Function ereg() is deprecated in /usr/share/gallery2/modules/core/classes/GalleryStorage.class on line 1120

errors like these continue for another couple of hundred lines, the installation of gallery2 stops there without a working gallery.

As can be seen on http://php.net/manual/en/function.ereg.php the ereg function has been deprecated as of PHP 5.3.0, PCRE compatible regular expressions (http://www.php.net/manual/en/book.pcre.php) should be used.

Revision history for this message
Guus Houtzager (ubuntu-houtzager) wrote :

Hey Teun :)

Correct that this is an annoying issue, but it's not the actual problem. I'm installing on Lucid, I assume you are too?
Some googling got me here:
http://gallery.menalto.com/node/95098
And sure enough once I changed

mysqli_options($this->_connectionID,$arr[0],$arr[1]);

to

mysqli_options($this->_connectionID,$arr[0],$arr[1][0]);

in /usr/share/php/adodb/drivers/adodb-mysqli.inc.php (line 98)

it went ok. I did restart the whole procedure after changing this line.

Now the question: in this a bug in Gallery2 or in libphp-adodb where this file is from? And did I break other stuff with this modification??

Regards,

Guus

Revision history for this message
Teun Vink (teunvink) wrote :

Hi Guus ;)

Thanks .This seems to "fix" the problem, I still get numerous deprecation warnings which makes the install look ugly, but at least it works. I did search on the menalto forum, didn't find anything useful, good to see someone at least figured out what the problem is.

I think the problem is at least partially in gallery2, since it provides its own adodb code in /usr/share/gallery2/lib/adodb/drivers

Revision history for this message
Loïc Minier (lool) wrote :

I can confirm the proposed change fixes gallery2 installation for me.

This file belongs to the libphp-adodb package, reassigning.

affects: gallery2 (Ubuntu) → libphp-adodb (Ubuntu)
Changed in libphp-adodb (Ubuntu):
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Loïc Minier (lool) wrote :

I tried understanding why the fix helped me finish the install for a while, and I think it is completely bogus; the following snippet reproduces the logic of the code before patching:
$optionFlags = array(array(MYSQLI_READ_DEFAULT_GROUP,0));
foreach($optionFlags as $arr) {
    print $arr[0] . "=" . $arr[1];
}

output is MYSQLI_READ_DEFAULT_GROUP = 0, which is just fine and is the intended behavior.

Changing it to $arr[1][0] outputs:
MYSQLI_READ_DEFAULT_GROUP =
instead, which means the option is set to the empty string instead of the intended value (zero). I grepped for other places setting optionFlags or for classes inheriting from the patched class, but found none, that's why I think the fix is really incorrect.

The intent of the code which is patched is likely to disable parsing of my.cnf (contrarily to what the comment says?!).

After googling a bit more, I found a report of a php5 segfault and after checking my sever logs, sure enough I found:
[Mon May 03 11:47:04 2010] [error] [client 192.168.122.1] PHP Deprecated: Function ereg() is deprecated in /usr/share/gallery2/modules/core/classes/GalleryStorage.class on line 1136, referer: http://<hidden>/install/index.php?step=7
[Mon May 03 11:47:04 2010] [notice] child pid 3346 exit signal Segmentation fault (11)

So I believe this is a php5 bug.

Revision history for this message
Loïc Minier (lool) wrote :

Reassigning to php5

affects: libphp-adodb (Ubuntu) → php5 (Ubuntu)
Revision history for this message
Loïc Minier (lool) wrote :
Changed in php5 (Ubuntu Lucid):
status: New → Confirmed
importance: Undecided → High
Changed in php5 (Debian):
status: Unknown → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.