New install very slow on ubuntu with ehcp

redbone

Joined: 2007-01-15
Posts: 5
Posted: Mon, 2012-04-16 14:40

I've performed a new install with gallery3 on my ubuntu box and with all the default features/no photos or anything... .its ungodly slow. I have serveral joomla sites on this server and they are all running fine/fast. I'm unsure where to begin with troubling shooting this issue. I've done a few google searches and over the years I've seen people suggest removing the php.ini and enabling internal caching. I've done this... but the slowness still exists.

I've attached my phpinfo page.

Here are some other particulars from the Gallery Admin Dashboard:

Version: 3.0.3 (Hotlanta)
Operating system: Linux 2.6.32-40-server
Apache: Apache/2.2.14 (Ubuntu)
PHP: 5.3.2-1ubuntu4.14
MySQL: 5.1.61-0ubuntu0.10.04.1
Server load: 0.11 0.11 0.05
Graphics toolkit: gd

I would like to use gallery... but can't with it being this slow! :(

Again, no pictures or any modules other than the default install. With nothing, its a 15+ second load time on my LAN

Here is ONE of the installs I've done.

http://www.seramabantams.com/gallery/

Thanks for any help you guys can give. I know it obviously shouldn't operate this way.

AttachmentSize
phpinfo.htm_.txt60.24 KB
 
redbone

Joined: 2007-01-15
Posts: 5
Posted: Mon, 2012-04-16 19:05

Finally found some good help....

First off, I upgraded to php 5.4 and got some valuable error messages back. After googling, I found this:

http://www.christopher-kunz.de/archives/276-Upgrade-woes-I-Gallery3-and-PHP-5.4.0.html

Quote:
I recently upgraded this machine to Debian Wheezy (mainly to fix odd kernel crash issues that occured a couple times now) and this included a new PHP version. 5.4.0 has been stable for a month now, so I was eager to give it a spin.

Almost all applications worked without any changes, apart from the popular “Gallery” script. Gallery3 just stopped working after upgrading to PHP 5.4.0. I maintain a fairly large gallery here, so it was vital for me to keep it running.

So, the TL;DR version to fix Gallery3 in Debian Wheezy with PHP 5.4.0:

set date.timezone = <your-timezone> in php.ini and restart Apache

comment-out line 530 in gallery3/system/core/Kohana.php

If you see everything twice (all pages are there twice), you have applied the wrong hotfix. Check in the bottom of the long entry for an explanation and a fix.

After restarting Apache, the application greeted me with this error:

Notice: Undefined offset: 1 in /home/www/htdocs/gallery3.christopher-kunz.de/system/libraries/I18n.php on line 60

Fatal error: Uncaught exception ‘Kohana_PHP_Exception’ with
message ‘Undefined offset: 1’ in
/home/www/htdocs/gallery3.christopher-kunz.de/system/libraries/I18n.php:60
Stack
trace:
#0
/home/www/htdocs/gallery3.christopher-kunz.de/system/libraries/I18n.php(60):
Kohana_PHP_Exception_Core::error_handler(8, ‘Undefined offse...’,
’/home/www/htdoc...’, 60, Array)
#1
/home/www/htdocs/gallery3.christopher-kunz.de/system/libraries/I18n.php(93):
I18n_Core::get_text(’Undefined offse...’)
#2
/home/www/htdocs/gallery3.christopher-kunz.de/system/core/Kohana_Exception.php(42):
__(’Undefined offse...’, NULL)
#3
/home/www/htdocs/gallery3.christopher-kunz.de/system/libraries/Kohana_PHP_Exception.php(60):
Kohana_Exception_Core->__construct(’Undefined offse...’)
#4
/home/www/htdocs/gallery3.christopher-kunz.de/system/libraries/Kohana_PHP_Exception.php(95):
Kohana_PHP_Exception_Core->__construct(8, ‘Undefined offse...’,
’/home/www/htdoc...’, 60)
#5 [internal function]:
Kohana_PHP_Exception_Core::shutdown_handler(NULL)
#6 /home/www/htdocs/gall in /home/www/htdocs/gallery3.christopher-kunz.de/system/libraries/I18n.php on line 60

Updating Gallery to the current version 3.0.2 didn’t fix the issue.
Neither did the latest Git checkout, and my locales were all fine and
dandy. When googling for the error, I found a thread where the original
Gallery author debugged this issue in an earlier version of Gallery.
That thread gave me a hint that the issue might have been caused by an
incorrect php.ini setting.

From wheezy on, Debian is packaging libapache2-mod-php5filter instead
of the old libapache2-mod-php5. This new module has a new subdirectory
in /etc/php5/ and thus brings a new configuration. I found that the way
to fix the I18n.php issue is setting a timezone like this:

vi /etc/php5/apache2filter/php.ini

Search for “timezone”

Change the commented line to:
date.timezone = CET
(or whatever your local time zone is)

Restart Apache: service restart apache2

After this, there was no more PHP notice and sad smiley - but there was no Gallery, either. All I got was a blank screen and no error was logged. Cranking up error_reporting and even trying the method described in the Gallery3 debugging guide did not yield any usable output.

Googling helped, again. It seems that the output buffering functions
have changed in 5.4.0. What was right for 5.3 seems to be broken now -
so output buffering methods in Gallery3 have to be tweaked slightly.

Change to your gallery3 root directory.

vi system/core/Kohana.php

:530 (go to line 530)

Comment out the ob_end_clean() call

Save & exit

After applying this hotfix, everything started working again.

EDIT: It seems that many people see everything twice - gallery pages,
login boxes etc. If so, you have applied an incorrect hotfix (you have
exchanged ob_end_clean() with ob_flush() or similar instead of
commenting it out). Comment the ob_end_clean() call instead of changing
it!
Hope this helps anyone.

 
redbone

Joined: 2007-01-15
Posts: 5
Posted: Wed, 2012-04-18 19:13

Hard to believe I'm the only one that's had this problem. My install of Ubuntu was very generic and I don't believe EHCP caused the issues. In the end, upgrading to PHP 5.4 resolved my problems.