I stopped working yesterday on the installation because I hit a pothole installing PHPStorm by JetBrains.
As I mentioned in the previous article, and in case you're just tuning in, I am first working towards a LAMP development environment on an older PC running 64-bit Linux. We've decided on CentOS 6 as the base distribution and installed the LAMP stack yesterday. I installed the PHPStorm package but hit a snag when I received an error message telling me that it required the JDK runtime ... thingys. (Whatever - I assiduously avoid Java.)
I installed the openjdk packages with yum and got PHPStorm to start-up, albeit with many dire warnings and threats to the graphics system. Apparently PHPStorm is comfortable running only with the jdk from SUN/Oracle.
I then downloaded and RPMd the SUN/Oracle version of the jdk and restarted. What happened next were error messages telling me that I need to set-up the java (dk) environment correctly as, now, the two were conflicting with each other.
[cc lang='bash' ]
ERROR: Cannot start WebIde. No JDK found to run WebIde. Please validate either WEBIDE_JDK, JDK_HOME or JAVA_HOME environment variable points to valid JDK installation.
See, in the linux world, the PHPStorm is launched from a shell script. It checks your environment for the JDK through these variables and, if correctly defined, launches the IDE.
There's a java-sdk configuration file located as /etc/java/java.conf -- don't make the same mistake I made and edit this file to re-direct/create environment variables so they point to the SUN/Oracle version of the JDK.
The SUN/Oracle version of the Java SDK installed in: /usr/java/jdk1.7.0/ which will change for your system depending, I'd assume, on your distribution and version of the SDK.
To reconcile the conflicts, I used the yum installer to remove any traces of the openjdk -- all packages were removed and then I did a yum clean all to reset the environment.
Since I'm the only user on this system, I next cd'd into my home directory and pulled up the .bashrc file - this will modify the bash shell environment for every terminal session I start. I added the following two lines to the .bashrc:
[cc lang='bash' line_numbers='true']
JDK_HOME=/usr/java/jdk1.7.0 export JDK_HOME
I exited the editor and reloaded my bash environment: [cc lang='bash' line_numbers='false']
# . ./.bashrc
From there, all I need to do is start the PHPStorm shell script which launches the application and I'm good to go!
You can install the PHPStorm folder anywhere. Using your bashrc file, you can make an alias to the start-up shell script so that you can launch the IDE anywhere from the CLI environment.
[cc lang='bash' line_numbers='false']
alias phpstorm='nohup /home/user/folder/PhpStorm/bin/PhpStorm.sh &'
The nohup allows the program to ignore SIGHUP -- in other words, if you close the terminal from where you launched PHPStorm, you will not close PHPStorm as well. The ampersand (&) at the end of the command tells the shell interpreter to launch the application as a "background" task which frees up your terminal session so that you can continue to use the shell while PHPStorm is running.
At this stage, I'm pretty much good to go for basic LAMP development. I've got a running mySQL server, Apache2 is good to go, and PHP5 is installed. I will enhance my environment by adding a few packages such as: