How can I use getenv in PHP?
Get the solution ↓↓↓I have written the following code: test.php
$java_path=getenv("JAVA_HOME");
echo 'Java Path : '.$java_path ."<br>";
when I run through command prompt (Ubuntu terminal) like:
>php test.php
Output:
Java Path : /opt/jdk1.8.0_161
I get the expected output, but when I run it through browser (Firefox),
http://localhost/test.php
I get empty value for Java Path. Output: Java Path :
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: your lock file does not contain a compatible set of packages. please run composer update.
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.