Today my license key for Intellij Idea arrived; first time I bought something commercial (except for games) in the past years. I did start webdevelopment with some WYSIWYG editors in windows, back when I was 11 up to 14. Due to all the problems that caused (not w3c conform, having to add hacks for several browsers, precise work was impossible, those editors created table based layouts, etc) and me learning PHP I started to use simple editors with syntax highlighting. When I switched completly to Linux (14 years now linux only) I was using bluefish and vim to do webdevelopment. I think one or two years ago, Till was showing me eclipse, my first IDE – I’ve been pretty impressed because he was hacking down a simple CRUD application within less than 5 minutes and eclipse was doing a lot of stuff automatically, so I switched to eclipse. But…
…there are some issues with eclipse. Sometimes the syntax highlighting is just stopping for files named php, the php support is not thaat good (java works like a charm, though) and once every few months eclipse crashes in a way that only re-installation or unpacking a backup helps. The installation of plugins/third party extensions is a dependency nightmare and for example now it just stopped to show the help-information for functions (it used to show the descriptions of php functions when doing mouse over, no idea why that stopped now). Then, if you had an power outage you have to re-import all your folders — gna — I’m not sure a commercial IDE will solve all this trouble, but I’m getting unhappier with eclipse from day to day.
At Lunar Linux Ratler told me he’s working with intellij idea, which is in his opinion the best IDE around. I took a look and since it has PHP support it’s exactly what I’m looking for (I was looking for an IDE with Java and PHP support). And then it happened, they had a special offer: 47€ instead of 189€ (with taxes about 56€ instead of 225€) – I couldn’t resist (thanks Till :p)
Here’s how I migrated from eclipse to idea within Ubuntu (for all lunar readers: yeah, shame on me for using Ubuntu, but hey, it works out of thaa box).
Step 1 – Prerequisites
Ubuntu has dropped Oracles / Sun’s Java so you have to add another repository to use it, if you don’t Idea will tell you:
OpenJDK Runtime Environment (IcedTea7 2.3.3) (7u9-2.3.3-0ubuntu1~12.10.1) OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode) OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode) WARNING: You are launching the IDE using OpenJDK Java runtime. ITS KNOWN TO HAVE PERFORMANCE AND GRAPHICS ISSUES! SWITCH TO THE ORACLE(SUN) JDK BEFORE REPORTING PROBLEMS! NOTE: If you have both Oracle (Sun) JDK and OpenJDK installed please validate either IDEA_JDK, JDK_HOME, or JAVA_HOME environment variable points to valid Oracle (Sun) JDK installation. See http://ow.ly/6TuKQ for more info on switching default JDK. Press Enter to continue.
To install sun’s java 7 do the following:
sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java7-installer sudo update-java-alternatives -s java-7-oracle
check if it worked by issuing:
wdp@vulkan:~$ java -version java version "1.7.0_10" Java(TM) SE Runtime Environment (build 1.7.0_10-b18) Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)
I assume that you already have downloaded idea and unpacked it in some directory (/home/wdp/Programme/idea here). I’m also assuming that you use the ultimate edition and obviously linux. You can start idea when you’re in it’s directory by issuing:
It will ask you for it’s license key. Remember to enter your user name correctly: Since my last name is „Brünn“ and I usually write it „Bruenn“ (no umlauts) and actually my name is written with a – (Jean-Michel) in registration it seems I accidently wrote it without (Jean Michel) that might be a bit tricky … 😀 however, reading the mail carefully will show you what name you picked… 🙂
When idea is running go to plugins, at the upper right is a search entry, type in PHP and install PHP and PHPUnit code coverage by right-clicking them in the left list and then clicking „download and install“. Pretty simple – Not as the nightmare I know from eclipse. Now click okay, press apply, it will ask you to restart, say yes 🙂
Time to install other stuff for proper development. Some of you might go for xampp, others might just install stuff using Ubuntu’s apt – And then there’ll be people like me who compiled that stuff from source, because we’re neither using xampp nor the distro-specific stuff on our servers for various reasons. Means, I’ll assume that you’ll have a webserver with PHP and a database server running – There are tons of guides on how to do that in ubuntu and for idea – Just pick one. Or just do something like that:
sudo apt-get install apache2-mpm-worker php5-geoip php5-memcached php5-imap php5-ffmpeg php5-imagick php5-mcrypt php5-memcache \ php5-sqlite php5-mysql php5-curl mysql-server \ libipc-sharedcache-perl libmcrypt-dev mcrypt tinyca memcached \ libcache-memcached-perl
Now go to the settings dialog in idea and click PHP. On the right you can add the php binary as interpreter. If you don’t know where it is located, you can issue:
wdp@vulkan:~$ which php /usr/bin/php
In case you’re wondering like I where to start a PHP Project – You have to create a Web Project (bit misleading since the title says „static web“ where as PHP is dynamic.
That’s it 🙂 Not sure if I’ll keep the dark theme, though. The normal ones are too bright on my monitor, the dark one, mhm. I’m not sure my eyes will like that if I work long. Stuff I did right after installing it like above:
- file -> settings -> appearance -> theme -> darcula (select)
- file -> settings -> editor -> appearance -> show line numbers (tick)
- file -> settings -> editor -> allow placement of carret after new line (untick)
- file -> settings -> php -> choose interpreter as explained above
- file -> deployment -> add new (local webserver, choose folder.. pretty self explaining
Right now, it was worth the money. Let’s see in a few weeks 🙂