posix_getuid is pointing to httpd instead of user from vhost

bobykus

Well-Known Member
#1
Is it normal?
When I run a script like


<?php
if (touch("/tmp/111")) {
echo $filename . ' modification time has been changed to present time';
} else {
echo 'Sorry, could not change modification time of ' . $filename;
}
echo posix_getuid()."\n";
echo posix_geteuid()."\n";

phpinfo();
?>

results are

ls -la /tmp/111
-rw-r--r-- 1 httpd httpd 0 Feb 4 16:28 /tmp/111

modification time has been changed to present time 398 398


php compiled with Server API LiteSpeed V6.1, it is running PHP suEXEC / suEXEC Daemon.
 

mistwang

LiteSpeed Staff
#2
Where did you put the script?
You can check the user PHP running as with command

ps -ef | grep php

also, have you tried PHP suEXEC without suEXEC daemon?
 

bobykus

Well-Known Member
#3
This is strange part - ps shows lsphp runnin under user privlgs.
Script is in document root of web site configured and exported from apache.
I'll do suexec with out demonizing.
 
Last edited:
Top