everzet's blog

  • About me
  • Card
  • GitHub
  • Behat
  • Mink
  • Capifony
  • Archive
  • RSS

Facebook’s “phpsh” - interactive shell for PHP

I love direction in which IRB for ruby works. My friend, Antono uses IRB very often when testing or debuging his RoR applications. So i feel, that i need something similar, but for PHP.

There are lot of different tryies to implement comfortable interactive shell in PHP, such as phpa or ~jk php shell. But i thinks, that Facebook developers with their phpsh found the best way of doing this & that’s why:

  • full commands history, based on readline;
  • tab completion for functions;
  • simple output highlight;
  • access to documentation for commands.

Screenshot

Facebook's phpsh

Unfortunately, it’s written mostly in python, so the install process is not trivial for most PHP devs. So, i’ve wrote a small manuals for you, Mac OS & Linux users =)

Install

Install under Mac OSX (10.5+)

  1. install python 2.6 from MacPorts, because python’s select.poll lib doesn’t work on MacOSX bundled python:
    • sudo macports install python26
    • sudo macports install python_select
    • sudo python_select python26
  2. install pysqlite for autocompletion:
    • wget http://pysqlite.googlecode.com/files/pysqlite-2.5.6.tar.gz
    • tar -xvf pysqlite-2.5.6.tar.gz && cd pysqlite-2.5.6
    • python setup.py build
    • sudo python setup.py install
  3. install phpsh:
    • git clone git://github.com/facebook/phpsh.git or download package here
    • cd phpsh
    • python setup.py build
    • sudo python setup.py install
    • cd /usr/local/bin
    • ln -s /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/phpsh

Install under Linux

  1. install pysqlite for autocompletion:
    • wget http://pysqlite.googlecode.com/files/pysqlite-2.5.6.tar.gz
    • tar -xvf pysqlite-2.5.6.tar.gz && cd pysqlite-2.5.6
    • python setup.py build
    • sudo python setup.py install
  2. install phpsh:
    • git clone git://github.com/facebook/phpsh.git or download package here
    • cd phpsh
    • python setup.py build
    • sudo python setup.py install
    • #php
    • #scripts
    • #CLI
    • #bash
  • 1 year ago
  • 11
  • Comments
  • Permalink
  • Share
    Tweet

11 Notes/ Hide

  1. minkiner liked this
  2. everzet posted this

Recent comments

Blog comments powered by Disqus
← Previous • Next →

About

Avatar Senior from-birth web developer, Symfony2 & BDD evangelist.
  • @everzet on Twitter
  • Facebook Profile
  • everzet on Youtube
  • everzet on Last.fm
  • everzet on Foursquare
  • My Skype Info
  • Linkedin Profile
  • everzet on github

Twitter

loading tweets…

Following

I Dig These Posts

  • Link via thechangelog
    ctrlp - Fuzzy file, buffer, mru and tag finder for Vim

    One of the biggest pain points for folks like me that switched to Vim from TextMate has been a...

    Link via thechangelog
  • Video via preppeller
    Video

    Just a quick video to show how easy it will be to import and export extensions in the next release of Alfred’s Powerpack :)

    The weather service I...

    Video via preppeller
  • Post via avalanche123
    Symfony2 DIC Component Overview

    As some of you might know, the Symfony2 framework consists of two main ingredients:

    • Components
    • Bundles

    The...

    Post via avalanche123
  • Link via thechangelog
    Git Extras: Helpful tools for Git

    If you’ve ever been working heavily on a project that uses git, you’d know, that sometimes it’s good to have a few...

    Link via thechangelog
See more →
  • RSS
  • Random
  • Archive
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr