Starting elasticsearch from an application

I'm a newcomer to elasticsearch but have found it very easy to install and use. However in order to make it part of an operational system, I need to be able to start it from a web based application using something like PHP's exec function or similar. Although I can start elasticsearch directly or as a service on the command line this does not work from the application.
I'm aware that this is really not an elasticsearch question, but I have extensively googled on this without finding a solution so I'm hoping that somebody has also had this requirement and has solved it.
I am using elasticsearch 0.17.6 on Centos 6 final.