Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Nov 13, 2009 9:37 am 
Offline
Newbie
User avatar

Joined: Fri Nov 13, 2009 8:14 am
Posts: 3
Website: http://mattgemmell.com/
Location: Edinburgh, Scotland (UK)
Hi there,

I have Ubuntu 9.10 (not 64bit) running with a basic LAMP stack (configured per the "Setting up a LAMP Server on Ubuntu 9.10 (Karmic)" guide on the Linode library), and a site running WordPress. The auto-upgrading function of WP is having some trouble, claiming that the zlib extension is missing - but it's not, it's definitely present and enabled.

I had a look at the actual code which was causing the problem, and it's checking whether the gzopen() function exists. Sure enough, PHP is reporting that gzopen() doesn't exist or isn't defined. Very odd. gzopen64() however does exist. This surprises me quite a bit, since plenty of PHP web apps use gzopen().

Does anyone have a suggestion as to how I can fix this? I've already tweaked the specific WordPress file (wp-admin/includes/class-pclzip.php) to use gzopen64() instead, and that allows the auto-upgrade functionality to work just fine, but it's not a long-term solution. For one thing, every auto-upgrade naturally replaces that file, so the same thing will happen next time.

I've googled around a bit and noticed plenty of tickets filed against Karmic when it was in beta, but nothing really definitive to solve the issue. This Karmic ticket mentions it's fixed in karmic-proposed, so I added

Code:
deb http://us.archive.ubuntu.com/ubuntu/ karmic-proposed restricted main multiverse universe


to my /etc/apt/sources.list then did an apt-get update and apt-get upgrade, restarted Apache, but I'm still seeing the issue. Any advice would be appreciated!

_________________
Matt Legend Gemmell
Mac OS X / iPhone Developer
Blog: http://mattgemmell.com/
Work: http://instinctivecode.com/


Top
   
 Post subject:
PostPosted: Fri Nov 13, 2009 12:00 pm 
Offline
Newbie
User avatar

Joined: Fri Nov 13, 2009 8:14 am
Posts: 3
Website: http://mattgemmell.com/
Location: Edinburgh, Scotland (UK)
Fixed now. There's an updated version of the php5 package which fixes this, but it won't be picked up by the standard apt sources file, so I wasn't seeing it. To fix the issue, do this:

1. Edit your /etc/apt/sources.list file and add this line at the bottom:

Code:
deb http://us.archive.ubuntu.com/ubuntu/ karmic-updates main restricted


You can change the "us." part to whatever mirror is best for you, but US should work great for Linode. You should then update apt's packages list by issuing the following command:

Code:
apt-get update


2. Now we need to get the new version of PHP (it's version "5.2.10.dfsg.1-2ubuntu6.1" specifically). Issue this command, and if it asks you to confirm just type Y and hit return:

Code:
apt-get install php5


3. Finally, we need to restart Apache to use the new version of PHP. Issue this command:

Code:
/etc/init.d/apache2 restart


That's it. Your zlib-related PHP functions like WordPress auto-upgrading should work fine now. You can test it on the command line too:

Code:
php -r 'var_dump(function_exists("gzopen"));'


If it worked, you'll see:

Code:
bool(true)


Hope that helps someone.

_________________
Matt Legend Gemmell

Mac OS X / iPhone Developer

Blog: http://mattgemmell.com/

Work: http://instinctivecode.com/


Top
   
 Post subject:
PostPosted: Sun Nov 15, 2009 12:40 am 
Offline
Senior Member

Joined: Thu Sep 11, 2008 10:49 pm
Posts: 70
ICQ: 4155271
Website: http://mikeage.net
WLM: msn@mikeage.net
Yahoo Messenger: m_i_k_e_miller
AOL: MikeageCM
Location: Israel
If you're using fastcgi instead of mod_php, please don't make the mistake of forgetting to restart your php-cgi processes!

I spent way too long trying to figure out why I was still getting this error despite having upgraded, and despite the fact that from the command line,
Code:
var_dump(function_exists("gzopen"))
worked just fine (using both php and php-cgi)!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group