Advice on Java install

General support questions
Post Reply
emilner
Posts: 2
Joined: 2015/07/27 13:23:17

Advice on Java install

Post by emilner » 2015/07/27 13:49:36

By my question, I'm sure most will recognize I'm not very experienced with linux, however, I'm stuck. Probably a simple knowledge gap.

I have a PHP application that is working well in my development environment on my windows machine (apache, mysql, php, java based reporting software called JasperReports).

I subscribed to a VPS service (from BlueHost.com) they do not support Java on their servers. I've installed jre1.8.0_51 on the VPS server, but am struggling with setting the environment variables.

The problem:
The java based reporting application doesn't run.
When I execute it from bash, it works, but from a PHP exec() call, it doesn't.

Troubleshooting:
When I echo $PATH & $JAVA_HOME from bash, I get the proper paths, but from a PHP exec() call, I get nothing for $JAVA_HOME and a different string for $PATH. I think this is the problem.
I was looking at the user that Apache runs under, and it appears to be 'nobody'. Is this the problem? I've tried to 'export' the correct $PATH and $JAVA_HOME statements in '/etc/environment' but no change.

Any help would be fantastic. Thanks
Ed

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Advice on Java install

Post by gerald_clark » 2015/07/27 16:45:32

The CentOS supplied httpd does not run as nobody.
Are you running cPanel or some other control panel?

emilner
Posts: 2
Joined: 2015/07/27 13:23:17

Re: Advice on Java install

Post by emilner » 2015/07/27 17:57:46

Gerald,
I am working with a VPS machine provided by BlueHost.com. They do use cPanel. I've looked at /usr/local/apache/conf/httpd.conf and confirmed that User and Group are both "nobody".
Ed

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Advice on Java install

Post by gerald_clark » 2015/07/27 18:00:42

CPanel replaces many of the CentOS programs with its own.
The whole web stack is non-CentOS, and any advice given here would likely break it more than it is now.
CPanel is a commercial product with paid support people.
You need to address all questions to cPanel support.

Post Reply