Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A couple of configuration questions

Status
Not open for further replies.

southbeach

Programmer
Jan 22, 2008
879
0
0
US
History:
Using SCO UNIX 5.0.7, PHP 4.4 and appache 1.3.36

My PHP script is not able to execute shell scripts through system() commands ... All works well off the command prompt or CLI.

Questions:
1) How do I know what user is PHP/Apache attempting to run as when I use the system() command? (NOTE: I tried using chmod u+s on the script but it still does not work).

2) How can I change this (the user)?

Thanks!


--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
 
Well, I found /usr/lib/apache/conf/httpd.conf has an entry where the user and usergroup can be defined. I changed these and restarted apache but my problem is still there. :-(



--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
 
Since you're using PHP, you can check by creating a PHP file containing "<php system('id'); ?>" and loading in in your browser.
 
That is exactly the kind of tests I have been using and nothing seems to work.

Code:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<?php system('id'); ?>
<body>

</body>
</html>

renders a blank page ... no errors ... nothing ...




--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
 
Well, I as able to get a blank page three ways, but none is probably your issue.

1. renamed my test.php script to test.html so PHP isn't executed.

2. renamed the 'id' command to the non-existant 'idz'. When I did this I did see "idz: not found" in the error_log, though.

3. chmod o-rx /usr/bin/id. Then I see "id: Permission denied" in error_log.

Sorry, no other thoughts yet.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top