473,385 Members | 1,256 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

php environment array

Hello,

I don't know that much about php but I was asked this question :

we have a testbox running Linux, Apache-1-3-29 and PHP/4.3.4

echo "<b>ENV</b><br>";
foreach($_ENV as $Name1=>$Key1)
{ echo $Name1." is: ".$Key1."<br>";
}

when this is executed it says somewhere that the logname is root.

However the apache server is running under the uid apache and group apache.

I suspected that when this is executed it would say that the logname is
apache or am I wrong assuming that ?

thanks,

Ron

Jul 17 '05 #1
2 2328
Ron Croonenberg wrote:
we have a testbox running Linux, Apache-1-3-29 and PHP/4.3.4

echo "<b>ENV</b><br>";
foreach($_ENV as $Name1=>$Key1)
{ echo $Name1." is: ".$Key1."<br>";
}

when this is executed it says somewhere that the logname is root.


I don't have that environment variable.
[ Debian GNU/Linux; Apache 1.3.29; php 4.3.3 ]
When I run phpinfo() Apache User/Group is "www-data" as expected.
If I do

$ ps aux|grep apache|grep -v grep

I get returned

root 1021 0.0 0.3 143764 1304 ? S Feb10 0:00 /usr/sbin/apache
www-data 1049 0.0 1.1 144056 4544 ? S Feb10 0:01 /usr/sbin/apache
....
(lots more "www-data")
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #2
Here's an excerpt of the script I use :

<?php //preprocessing of form data

echo "<b>ENV</b><br>";
foreach($_ENV as $Name1=>$Key1)
{ echo $Name1." is: ".$Key1."<br>";
}
?>
I think it is supposed to run on any php/apache combination.

Ron

Pedro Graca wrote:
Ron Croonenberg wrote:
we have a testbox running Linux, Apache-1-3-29 and PHP/4.3.4

echo "<b>ENV</b><br>";
foreach($_ENV as $Name1=>$Key1)
{ echo $Name1." is: ".$Key1."<br>";
}

when this is executed it says somewhere that the logname is root.

I don't have that environment variable.
[ Debian GNU/Linux; Apache 1.3.29; php 4.3.3 ]
When I run phpinfo() Apache User/Group is "www-data" as expected.
If I do

$ ps aux|grep apache|grep -v grep

I get returned

root 1021 0.0 0.3 143764 1304 ? S Feb10 0:00 /usr/sbin/apache
www-data 1049 0.0 1.1 144056 4544 ? S Feb10 0:01 /usr/sbin/apache
...
(lots more "www-data")


Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: jwpioneer | last post by:
I have a need within an application to modify the path environment variable, as I need to find specific directories and remove them. I use the following code to do this: RegistryKey rkey = ...
1
by: Markus Ernst | last post by:
Sorry for the multipost - I forgot to crosspost and alt.php gets less attention than comp.lang.php... And I hope this will work with UTF-8. In order to make strings suitable for URLs in a UTF-8...
19
by: Vijay Kumar R Zanvar | last post by:
Hi clc, I want to know few examples of freestanding environments. -- "There's money in this case, Watson," he continued, glancing out of the window, "if there is nothing else." - A Scandal...
26
by: learner | last post by:
Hi, What is the difference between accessing environment variables through int main(int argc,char *argv,char *envp) and extern char **environ;
5
by: Vamsi | last post by:
Hi, I am trying a basic opearation of splitting a multiline value to an array of single lines(Actually making Address into AddressLine1, AddressLine2). I used Environment.NewLine in split, I...
16
by: Chad Z. Hower aka Kudzu | last post by:
Im using Environment.GetCommandLineArgs(). However some of the arguemtns passed in have spaces, so I enclosed them in "". For example: "c:\temp\My area\" The problem is when I access...
11
by: Lloyd Dupont | last post by:
(not I use 2.0, so new return a "normal" pointer and gcnew return a managed one, my question below regarding new concern plain standart C++ allocator) - if I use the default new operator, are all...
6
by: yaron | last post by:
Hi, my application use environment variable, let call it FOO. how can i add the FOO environment variable to my project or my solution, so the line string foo =...
1
by: Albertas | last post by:
Hello, I have function written in unmanaged environment, which takes as parameters char*. For example: void function(char *input, char *output); It takes two char arrays and modifies the output...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.