Jump to content

I want to run tomcat's startup.sh with php exec().


linguafranca

Recommended Posts

Hi!

 

I should mention that I'm horrible at php. I did my googling, and asked somebody before coming here though. Anyhow, I'm stuck, and I need help.

 

I'd like to run Tomcat's '/bin/startup.sh' startup script with php (BTW, Tomcat - a java "server"; it is run by executing the forementioned script). When I write:

 echo exec('MY_PATH/tomcat6/bin/startup.sh'); 

I get the response that "At least one of these environment variable is needed to run this program" which looks like the last line of tomcat's common error message:

Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program

 

When I run:

 echo exec('export JRE_HOME=MY_PRECIOUS_PATH');

it neither helps nor returns anything.

 

Is it possible to set an environment variable for www-data account with php?

Thanks in advance!

 

Link to comment
Share on other sites

exec() is actually disabled by most shared hosts, and im not sure if by default. It poses some security risks. I had the same problem. If you are not shared, edit php.ini. you might find thats the problem. If it isn't, im not really sure, sorry.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.