Set open_basedir directive per user

#1
Hello everyone,

Is there a way to wrap the lsphp5 process so that open_basedir may be set similar to this php-cgi wrapper that works in conjunction with suexec:
#!/bin/sh
HOMEDIR=`grep ":$UID:" /etc/passwd | cut -d: -f6`
ARGS="-d safe_mode=0 -d open_basedir=/tmp/:$HOMEDIR/httpdocs/"
exec /usr/bin/php-cgi $ARGS

This operates the way it should using old school mod_php or mod_fastcgi but we want to use lsapi/lsphp -- that is what makes litespeed so great!

Regards,
Thomas Z
 

mistwang

LiteSpeed Staff
#2
open_basedir works with lsphp, just like with mod_php.
Just override open_basedir with php_admin_value in the vhost configuration. that's the way cPanel generate the vhost configurations.
 

NiteWave

Administrator
#4
I think no such dynamic way like php-cgi you showed in first post.

while in .htaccess, you can put
php_value open_basedir /home/mydomain/public_html:/tmp
in lsws + lsphp, but not available in php-cgi way.

also in lsws php suExec mode, each account can have its own unique php.ini, to set everything include open_basedir.

I think they are just different approaches.
 
Top