Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 961517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:21:27+00:00 2026-05-16T01:21:27+00:00

I have written a Java application that runs from the command line. I want

  • 0

I have written a Java application that runs from the command line. I want to allow users to access this via a simple PHP web interface – it’ll just allow them to specify certain parameters, and then execute the java app and return the output.

For some reason, I’m getting a ‘Permission Denied’ error message when I try to do anything with Java, even something as simple as:

shell_exec('/usr/bin/java -version 2>&1');

returns ‘sh: /usr/bin/java: Permission denied ‘ when run through a browser.

If I give apache a shell account and log in as apache, I can execute this command fine.

Is there some kind of setting preventing the JVM running if there is no associated tty? How can I get this to work? I’m running PHP 5.3.2.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T01:21:28+00:00Added an answer on May 16, 2026 at 1:21 am

    Your application host may be confined with a tool like AppArmor or SELinux or TOMOYO or SMACK, or similar confinement tools.

    It would be very simple to confine an Apache to allow executing /usr/bin/whoami but not /usr/bin/java.

    Ask your system administrator to grant access to java and your jars for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that was written in Java and runs on the users
I have this application written in java to calculate pageranks. And the application takes
In our application, I have seen code written like this: User.java (User entity) public
I have written a simple Java application that interacts with multiple instances of itself
I have an application written in Java that performs some straightforward but time consuming
I have written a java application that sporadically logs events to an SQLite database
I have written java application that makes socket connections with a legacy system. How
I have written this event photography application that features a slideshow among other things.
I have written a Java application that I would like to run inside of
I have an application written on Java running on the machine (Linux/Windows). I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.