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 8693237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:30:17+00:00 2026-06-13T00:30:17+00:00

I have jdk1.7.0_07 installed on server(linux). The file permission to ~/bin files are executable(755).

  • 0

I have jdk1.7.0_07 installed on server(linux). The file permission to ~/bin files are executable(755). However when I tried to execute,

$output = exec("/usr/java/jdk1.7.0_07/bin/java -version 2>&1");
echo $output;

It gives permission denied error, I have tried this,

$output = exec("java -version 2>&1");
echo $output;

Which gives command not found error. While checking my environment variables. I have succesfully added JAVA_HOME = /usr/java/jdk1.7.0_07 and for PATH = /usr/java/jdk1.7.0_07/bin

But,

When I run above mentioned PHP script it keeps giving me those permission denied or command not found error. Any personal experience or clue?

  • 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-06-13T00:30:18+00:00Added an answer on June 13, 2026 at 12:30 am

    If you are running these commands from the command-line, you probably execute them with your own user permissions. However, when you execute these same commands via a PHP script in a web app, they will be executed with the Apach user (typically www-data) permissions. These means that you cannot rely on the command-line output to debug permission errors unless you can log in as the exact same user that runs your PHP script.

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

Sidebar

Related Questions

I am running Ubuntu 11.10 and have installed jdk-6u30-linux-i586.bin and have a directory /usr/local/jdk1.6.0_30
I have applet which I run in command line like this: C:\Program Files (x86)\Java\jdk1.6.0_21\bin\appletviewer.exe
I have installed java and tomcat appache server on linux. When i am going
I have installed jdk 1.7 in C:\jdk1.7.0 directory and JCreator in C:\Program Files directory
I have recently made a .JAR file called Electronics.jar (located in C:\Java\eclipse\Java\jdk1.7.0_03\bin>Electronics.jar) and it
I have added Path variable 'C:\Program Files\Java\jdk1.6.0_21\bin' in Environment Variables, but it still gives
I have installed jdk1.6.0_21 and sqldeveloper(using alien) on debian(lenny). Now when I run sqldeveloper
C:\Program Files (x86)\Java\jdk1.6.0_17\bin>javac VendingMachine.java VendingMachine.java:27: error while writing VendingMachine: VendingMachine.class (Access is denied) public
I downloaded commons-net-3.0.1-bin.zip file and extracted it to java lib folder. I have set
I have jdk1.6.0_13 installed, but when I try to find a javax.servlet package, or

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.