Postcards From My Life

Lint I find in my mind's belly-button.
  • EPK
  • Consulting
  • Resume
  • Nerd Herding
  • Talks
  • How to Plan a Website
  • Zend Framework
« MySQL Workbench – A Superficial Review
Lessons in Phar »

XAMPP, PHP 5.3, PEAR, and PHAR (what a mess)

Dear Reader,

The Short Version

If you are installing PHP 5.3 and when you run go-pear.bat you get this:

phar "C:\xampp\php\PEAR\go-pear.phar" does not have a signature

Edit your php.ini file and find the lines:

; http://php.net/phar.require-hash
; phar.require_hash = On

Change them to :

; http://php.net/phar.require-hash
phar.require_hash = Off

Save and then run

go-pear

The Long Version

As the sun arose and illuminated the sky, I thought as I was waking up that today would be a good idea to upgrade my local install of PHP to 5.3. This is proof, once again, that I should not listen to the voices in my head…ever.

XAMPP

I use XAMPP as my WAMP stack. The first thing I did was go out and check to see if they have released a version with 5.3. Sadly, they had not, as of this writing. (I found that odd because they are usually very punctual on these things) Since they didn’t have it, I decided to just grab the binaries from php.net and do it myself. (How hard could it be, right?)

PHP.NET

Ok, the first thing you have to decide with PHP on Windows is which version. Looking through my options, VC6 x86 Non Thread Safe seemed to be the one I needed. Since I already had PHP installed and just wanted to update it, I decided on the ZIP instead of the installer. (I was pretty sure the Debug Pack wasn’t what I was looking for)

Download, Unzip, rinse repeat. You know how this part goes. XAMPP puts php in c:\xampp\php. I simply moved that out of the way, made a new one and unzipped the contents into it. This is where things got a bit weird.

PEAR and PHAR

My PEAR dir was now empty except for go-pear.phar. Since my php directory had go-pear.bat I figured, what the heck, I’ll give it a shot. No dice, this time. As soon as I executed the batch file, I got:

phar "C:\xampp\php\PEAR\go-pear.phar" does not have a signature

Hmmm….that’s new.

Ok, some quick googeling around found me this possible solution from Thijs Lensselink. I tried it, nope, would not work. However, it did lead me down the correct path. I started digging into the Phar manual to find out what the require_hash options was all about. It turns out that, if that’s on, for security purposes it can’t be overridden. Since the default is on, I had to open up my php.ini, find it and set it to off. Once it’s off, everything works just fine.

Edit your php.ini file and find the lines:

; http://php.net/phar.require-hash
; phar.require_hash = On

Change them to :

; http://php.net/phar.require-hash
phar.require_hash = Off

Conclusion

I’m not sure why the go-pear.phar doesn’t contain a valid hash, I assume the PEAR group will fix that in 5.3.1. Until then, just make sure you at least temporarily set require_hash=Off in your php.ini and you should be good to go. It’s probably a good idea to turn it back on when you’re done.

Until next time,
(l)(k)(bunny)
=C=

Tags: pear, phar, PHP, require_hash, xampp

This entry was posted on Saturday, July 11th, 2009 at 8:38 am and is filed under PHP, Programming. You can follow any responses to this entry through the RSS 2.0 feed.Both comments and pings are currently closed.

12 Responses to “XAMPP, PHP 5.3, PEAR, and PHAR (what a mess)”

  1. Pierre Says:
    July 11th, 2009 at 9:58 am

    hi!

    See http://news.php.net/php.internals/44569

    PEAR developers forgot to update the phar after a signature related bug fix. The phar are fetched automatically when we package the release, using:

    http://cvs.php.net/viewvc.cgi/pear/installphars/

    Cheers

  2. Jan Says:
    July 13th, 2009 at 1:07 am

    I’ve also run into the same problem. If you don’t want to edit your php.ini:

    php -d phar.require_hash=0 PEAR/go-pear.phar

  3. Cal Evans Says:
    July 13th, 2009 at 1:35 am

    @Pierre,

    Thanks for the links.

    @Jan,

    Actually I tried that and for some reason couldn’t make it work. Originally, i thought it was because the manual says that require_hash can’t be overridden but since that’s also how Greg recommends fixing the problem, possibly, I did something wrong. I will try it again.

    Thanks to the both of you for the comments.
    =C=

  4. Cal Evans’ Blog: XAMPP, PHP 5.3, PEAR, and PHAR (what a mess) | DreamNest - Technology | Web | Net Says:
    July 13th, 2009 at 10:00 am

    [...] Evans had an issue – it involved XAMPP, PHP 5.3, PEAR and phar: If you are installing PHP 5.3 and when you run [...]

  5. Cal Evans’ Blog: XAMPP, PHP 5.3, PEAR, and PHAR (what a mess) | Webs Developer Says:
    July 13th, 2009 at 10:02 am

    [...] Evans had an issue – it involved XAMPP, PHP 5.3, PEAR and phar: If you are installing PHP 5.3 and when you run [...]

  6. Focus On | News | Server-Side Magazine Says:
    July 14th, 2009 at 7:35 am

    [...] Cal Evans Blog – XAMPP, PHP 5.3, PEAR and PHAR (what a mess) [...]

  7. Thijs Lensselink Says:
    July 15th, 2009 at 6:25 am

    Thanks for digging a bit deeper into this problem. I’ll update my post.

  8. PEAR install weirdness at A cloud of thoughts Says:
    July 15th, 2009 at 6:36 am

    [...] this solution seems to have resolved the problem for me. Cal Evans has a good post how to resolve this issue as well. My workaround didn’t solve the problem for Cal but his did [...]

  9. Lessons in Phar – techPortal Says:
    July 21st, 2009 at 2:43 am

    [...] XAMPP, PHP 5.3, PEAR, and PHAR (what a mess) (8) [...]

  10. Packaging Zend Framework As A Phar Revisited – techPortal Says:
    July 27th, 2009 at 12:24 am

    [...] XAMPP, PHP 5.3, PEAR, and PHAR (what a mess) (9) [...]

  11. SQLYog – A superficial review – techPortal Says:
    July 28th, 2009 at 4:43 am

    [...] XAMPP, PHP 5.3, PEAR, and PHAR (what a mess) (10) [...]

  12. press.li Says:
    August 6th, 2009 at 1:44 pm

    I’ve run into the same ,too.Thank you very much!

  • Follow me on twitter!

  • My Latest Book


    Avoiding a Goat Rodeo

  • RSS PHP Podcasts

    • MicroPHP vs Complicated PHP – Lately in PHP podcast episode 20
    • SitePoint Podcast #147: The CSS Ninja with Ryan Seddon
    • SitePoint Podcast #146: Patrick Accidentally Installs Chrome
    • Episode 95: Jeff Carouth at ZendCon 2011
    • DPC Radio: Advanced OO Patterns
    • SitePoint Podcast #145: Backbone.js Fundamentals with Addy Osmani
    • SitePoint Podcast #144: Freemium Schmeemium
    • The Debate of Making PHP Faster using a JIT Compiler – Lately in PHP podcast episode 19
    • SitePoint Podcast #143: Happy HTML5 Holidays with Bruce Lawson
    • DPC Radio: Profiling PHP Applications

  • Me

    • Best web design company
    • Cal Evans Dot Com
    • Cheap Wine Diary
    • Cyrano’s Apprentice
    • Evans Internet Construction Company
    • My Life as a Child
    • PHP Podcasts
    • Sixty Second Tech

  • Tags

    adobe API article book Cal Evans codeworks community conference cw09 developers drupal elizabeth naramore Exim facebook flex freelance fun IBuildings Kathy Evans linkedin Management Marketing microsoft MySQL Nashville phar PHP phparchitect php developers podcast Programming Quickies respect Silly-Con Valley sixty second tech software development speaking startup twitter upgrade video web development wordpress zend zend framework

  • Categories

    • Apache
    • BlogBling
    • Blogging
    • codeworks
    • Entertainment
    • Entrepreneurship
    • Flex
    • Humor
    • JavaScript
    • Long Form
    • Management
    • Marketing
    • Me
    • PHP
    • podcasting
    • Programming
    • SQL
    • Technology
    • Web 2.0
    • wordpress
    • WordPress Plugins
    • writing
    • zend framework


Postcards From My Life is proudly powered by WordPress
Entries (RSS) and Comments (RSS).