Postcards From My Life

Lint I find in my mind's belly-button.
  • EPK
  • Consulting
  • Resume
  • Nerd Herding
  • Talks
  • CWJ 09
« 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=

Related posts

  • Packaging Zend Framework As A Phar Revisited (3)
  • Lessons in Phar (16)
  • Forks!=Threads! (0)

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!

  • Team Based PHP Training

  • Sponsors and Ads

  • Conferences I’m Attending

  • About Me

    cal_evansThis is my blog. Sometimes it's my deep thoughts, sometimes it's a journal of things I've learned. Every now and then it's my box of shattered dreams. Most of the time though, it's just the place I like to write. Sit with me as I show you some postcards from my life. While you are here, do me a favor and leave a comment.

    If you are looking for my contact information, bio, picture, ASL, check out my EPK.

    My name is Cal Evans and this is my blog.



    Follow me on FriendFeed!

    View Cal Evans's profile on LinkedIn

  • My First Book

  • Support PHPWomen


    US Shop | European Shop

  • What I'm Doing...

    • I'm at Golden Eagle Stirfry (6900 Lenox Village Dr. Suite 28, Nashville). http://4sq.com/4xqsLs 9 hrs ago
    • Dear shopnhl.com. you suck. KTHNXDIE. 12 hrs ago
    • @mrnordstrom it will be in our podcast stream in 2 weeks. keep an eye on phparch.com if you've not already subscribed. in reply to mrnordstrom 12 hrs ago
    • More updates...

  • Tags

    API article Cal Evans codeworks conference contest cw09 developers devzone elizabeth naramore Exim flex fun IBuildings iPod jobs Kathy Evans linkedin Management Marketing microsoft MySQL Nashville phar photography PHP phparchitect php developers podcampnashville podcast podcasting poem Programming Quickies respect Silly-Con Valley sixty second tech software development terry chay twitter upgrade video wordpress zend zend framework

  • RSS PHP Podcasts

    • webcast: Introduction to Doctrine 2
    • 8 Reasons Every PHP Developer Should Love JavaScript
    • oddWeek Episode #4
    • Creating Custom Zend_Form Decorators
    • Habits of Highly Scalable Web Applications
    • PHPSPCast #6 – Ao vivo da Campus Party (Q&A)
    • php|architect Podcast: oddWeek #002
    • php|architect podcast: oddWeek #003
    • Podcast #2010-02: Stalker Edition
    • php|architect Podcast: oddWeek #001

  • XBox Gamer Card

  • Me

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

  • RSS My Blog at php|arch

    • An error has occurred; the feed is probably down. Try again later.

  • Flickr Recent Photos

    Blue Parabola Southern Office-Rear Annex is closed for snowSnow Heart@dzuelke getting ready to give his talk@fabpot talking about Dependancy Injection@derickr giving the opening keynotePeople meeting other peoplePHP Benelux Goody Bag ContentsCheck InDSCN2280The main room

  • 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

  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org


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