Configuring Emacs for PHP

Ben Simon has a nice post on setting up Emacs for PHP. I don't write in PHP and have no plans to start but Simon says it's hard to get an intelligent setup for it that works for all PHP coding styles.

Simon recommends using php-mode from Melpa instead of the one that comes built into Emacs. That works well for files that are strictly code but for files that have markup he recommends web-mode. He gives his configuration for both packages; they should provide a good starting point for your own setup.

If you like autocompletion, you might also want to try ac-php. Simon shows a configuration for that as well. Simon offers step-by-step installation and set up instructions for each of these packages and says that together they make for a modern PHP development environment.

This entry was posted in General and tagged . Bookmark the permalink.
  • Thanks for the mention!

    One of the challenges of being a long time Emacs user is that it's easy to get stuck in your ways. I'd been limping along on hacked up PHP setup for so long, I hadn't even realized it.

    I'm loving my new PHP setup and it's a great reminder to bust out and try new stuff more often.