Install PhpBeautifier Plugin for Sublime Text 2 in Mac

1. Install PhpBeautifier from pear channel : sudo pear install –alldeps channel://pear.php.net/php_beautifier-0.1.15

2. Install PhpBeautifier plugin in Sublime text. Press cmd+shift+p and select Package Control:Install Package. Then select PhpBeautifier.

sublime_package_install

3. Select Browse Packages… in menu. Find PhpBeautifier folder and edit php_beautifier.py in it.

sublime_menu_package

4. Edit line in php_beautifier.py

cmd = “php_beautifier”

to

cmd = “/Users/username/pear/bin/php_beautifier”

5. Edit Pear.filter.php , phpBB.filter.php in /Users/username/pear/share/pear/PHP/Beautifier/

comment this line

require_once(“PEAR/Config.php”);

6. Press cmd+shift+p and select Format:Php