Deprecated errors after Ubuntu 10.04 upgrade.

qhaz
qhaz's picture

Joined: 2009-04-26
Posts: 3
Posted: Wed, 2010-05-05 22:59

Hi all.

Recently after upgrading to Ubuntu 10.04 my Gallery2 seems to be broken.

http://qhaz.net:8888/gallery2/main.php

On the top of my page I get this error message . . .

Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/gallery2/bootstrap.inc on line 43

No images or thumbnails are loaded.
I am unable to login as adminstrator.
Can anyone shed some light on this problem?

cheers
qhaz


Gallery version 2.3-1ubuntu3
PHP version 5.3.2-1ubuntu4.1
PHPInfo Link http://qhaz.net:8888/public_html/phpinfo.php
Webserver Apache 2.2.14-5ubuntu8
Database MySql 5.1.41-3ubuntu12
Activated toolkits
Operating system Linux Ubuntu 10.04 with kernel 2.6.32-22
Browser Firefox 3.6.3

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Wed, 2010-05-05 23:12

You're running 2.3 which isn't compatible with PHP 5.3

Upgrade to 2.3.1
FAQ: How to upgrade Gallery2?

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
qhaz
qhaz's picture

Joined: 2009-04-26
Posts: 3
Posted: Thu, 2010-05-06 07:16

Thanks nivekiam for your quick reply!

qhaz

 
quasimagyar

Joined: 2010-05-07
Posts: 1
Posted: Fri, 2010-05-07 08:04

I managed to fix the problem by doing the two following things:

1) Change error reporting line in /etc/php5/apache2/php.ini from

error_reporting = E_ALL & ~E_NOTICE

to

error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED

2) In /etc/gallery2/config.php change the line

$storeConfig['type'] = 'mysqli';

to

$storeConfig['type'] = 'mysqlt';

Restarted Apacahe, and then all was fixed (at least for me).

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Fri, 2010-05-07 13:20

quasimagyar's first action will indeed "solve" the problem by hiding the error messages generated when using v2.3.0 with PHP 5.3.

For those that wish to actually solve rather than hide the PHP 5.3 compatibility issues, the answer is to upgrade to v2.3.1 as advised above

--
dakanji.com

 
robertomason
robertomason's picture

Joined: 2004-03-14
Posts: 3
Posted: Mon, 2010-05-10 17:29

I have ubuntu 10.04 fresh install, not an upgrade. when I look at what version of Gallery2 I have, the file name is 2.3-1ubuntu3. Is this still to say that it's version 2.3 and not version 2.3.1?

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2010-05-10 17:55

That's Ubuntu's wacky and poor naming scheme. IME (in my experience) most package maintainers do very little testing with Gallery2 (probably none at all, I wonder if the Ubuntu or Fedora peps have even install it, I know they can't possibly be running G2 because their installs would break just like everyone else's when they upgrade stuff like PHP or Smarty....)

IMO, Gallery2 should be stricken from Ubuntu's and Fedora's repositories because it's obvious the maintainers of those packages do very little to make sure it works.

I was able to look at your (oh wait, not yours but the original poster of this thread) /modules/core/module.inc file and it shows 2.3.0 is your version for Ubuntu's version of "2.3-1ubuntu3"

Do yourself a huge favor and apt-get remove gallery2, then just download it from here and install it manually. That way it won't break when Ubuntu (or Fedora) upgrade something like Smarty and you'll just keep ticking right along.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
robertomason
robertomason's picture

Joined: 2004-03-14
Posts: 3
Posted: Mon, 2010-05-10 20:17

I started a fresh install. I downloaded 2.3.1 typical. Did an apt-get for the following ffmpeg jhead dcraw php5-gd netbm smarty unzip zip and myconfig-common. I did this because when I removed gallery-2.3.0 from Ubuntu, these dependencies were removed. Logically I re-installed them separately.

Then I install gallery2 2.3.1 typical

I ran into a problem at step #8 Install Gallery Core.. This is the message I got

Catchable fatal error: Object of class GalleryStorageExtras could not be converted to string in /usr/share/www/photo.rmasonfamily.info/lib/adodb/drivers/adodb-mysqli.inc.php on line 98

Thanks :)

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Mon, 2010-05-10 20:44

Try switching from mysqli to mysqlt in your config.php.

It is not generally advisable to use bleeding edge distros such as Ubuntu (non LTS) and Fedora as server OS in general IMO and in particular latest releases as there are invariably incompatibilities and dare I say it, bugs to be found.

Also try to run yum (or whatever the ubuntu equivalent is) update now and then to get the fixes released sooner or later.

--
dakanji.com

 
robertomason
robertomason's picture

Joined: 2004-03-14
Posts: 3
Posted: Mon, 2010-05-10 23:40

Thanks for trying, but it still doesn't work

:)

 
tstroff

Joined: 2010-07-29
Posts: 1
Posted: Thu, 2010-07-29 00:26

Thanks to quasimagyar for the work-around. I ventured into the upgrade of Ubuntu without doing my homework. This got me up and running again so I could do a less painful upgrade of Gallery.

Cheers to you all for your commitment to the community at large. :-)

Quote:
1) Change error reporting line in /etc/php5/apache2/php.ini from

error_reporting = E_ALL & ~E_NOTICE

to

error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED

2) In /etc/gallery2/config.php change the line

$storeConfig['type'] = 'mysqli';

to

$storeConfig['type'] = 'mysqlt';

Restarted Apacahe, and then all was fixed

 
usr-local-dick

Joined: 2010-08-11
Posts: 1
Posted: Wed, 2010-08-11 10:09

I just ran into this. It would be ideal for Ubunto update their packaged gallery to 2.3.1, so it would fit the used php 5.3.2.
I doubt that will every happen, but because it looks like only a couple of small issues that are easy to patch, I don't want to uninstall the package and install from source either.

After a couple of days running I have accumulated these errors:

Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/gallery2/bootstrap.inc on line 43
Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/gallery2/install/steps/DatabaseSetupStep.class on line 605
Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/gallery2/lib/bbcode/stringparser_bbcode.class.php on line 1210
Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/gallery2/lib/bbcode/stringparser_bbcode.class.php on line 1221
Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/gallery2/lib/bbcode/stringparser_bbcode.class.php on line 1264
Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/gallery2/lib/bbcode/stringparser_bbcode.class.php on line 1281
Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/gallery2/lib/bbcode/stringparser_bbcode.class.php on line 1535
Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/gallery2/lib/bbcode/stringparser_bbcode.class.php on line 567
Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/gallery2/lib/bbcode/stringparser.class.php on line 285
Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/gallery2/lib/bbcode/stringparser.class.php on line 982
Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/gallery2/modules/core/classes/GalleryStorage.class on line 290
Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/gallery2/modules/core/classes/GalleryUtilities.class on line 854
Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/gallery2/upgrade/index.php on line 171
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 1136
Deprecated: Function ereg_replace() is deprecated in /usr/share/gallery2/modules/core/classes/GalleryTemplateAdapter.class on line 712
Deprecated: Function ereg_replace() is deprecated in /usr/share/gallery2/modules/core/classes/GalleryTemplateAdapter.class on line 713
Deprecated: Function ereg_replace() is deprecated in /usr/share/gallery2/modules/core/classes/GalleryTemplateAdapter.class on line 714
Deprecated: Function set_magic_quotes_runtime() is deprecated in /usr/share/gallery2/modules/core/classes/Gallery.class on line 870
Deprecated: Function split() is deprecated in /usr/share/gallery2/lib/adodb/drivers/adodb-postgres64.inc.php on line 662

I wrote a patch that fixes these if applied to 2.3-1ubuntu3 on Lucid installed. Download the patch, cd /usr/share/gallery2, then patch -p0 < gallery-ubuntu-lucid-2.3-1ubuntu3.patch.
Basically, ereg -> preg, split -> explode, and =& to =.

While not ideal, I think it is better than simply hiding deprecated messages.
However, use with care.