Home > Linux > Emacs Quick PHP Configuration

Emacs Quick PHP Configuration

Some distributions install Emacs “fully loaded” with all the bells and whistles, some just install Emacs with the expectation that you’ll configure it to your liking.  This post will just give you the skinny on getting Emacs working with php nice and quick.

  1. Install Emacs.
  2. Go to http://php-mode.sourceforge.net/ and download and extract the latest php-mode.el in the .emacs.d directory of your home directory or in a directory of your choosing.
  3. Create or append the following in you ~/.emacs file being sure to give the proper location of you php-mode.el file.

    (setq inhibit-splash-screen t)
    (add-to-list ‘load-path “~/.emacs.d”)
    (require ‘php-mode)
    (add-to-list ‘auto-mode-alist ‘(“\\.ctp$” . php-mode))

  4. Save your .emacs file and test emacs on a php file.  You should get all the nice color coding and other niceties.  Incidentally, omit the first line about splash screen if you enjoy seeing it every time you start emacs.

If you find this post useful please leave us a comment.  Thank you!

Categories: Linux Tags: ,
  1. No comments yet.
  1. No trackbacks yet.