Setup a per-user php.ini to allow open_basedir with suPhp

itdungpt

Active Member
Feb 21, 2012
31
0
56
cPanel Access Level
Website Owner
you misunderstand the problem.

demo : -link removed-

Open_Basedir: /home/vnseoerc:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp
with vnseoerc = username host
 
Last edited by a moderator:

itdungpt

Active Member
Feb 21, 2012
31
0
56
cPanel Access Level
Website Owner
Well, it's kind of hard to make out with your messages. I don't think linking to a compromised account is the best way to explain what you want either.
Setup a per-user php.ini to allow open_basedir with suPhp

On DirectAdmin :

edit : /usr/local/directadmin/scripts/custom/user_create_post.sh

paste:

#!/bin/sh

HOME=/home/$username
OBD="${HOME}/:/tmp:/var/tmp:/usr/local/lib/php/"

P=/usr/local/directadmin/data/users/$username
if [ ! -e ${P}/php ]; then
mkdir ${P}/php
fi

PI=${P}/php/php.ini
if [ ! -e ${PI} ]; then
cp -f /usr/local/lib/php.ini.template ${PI}
TMP="perl -pi -e 's#open_basedir = OBD#open_basedir = ${OBD}#' ${PI}"
eval $TMP
fi
exit 0;


on /usr/local/lib/php.ini
set

PHP:
open_basedir = [B]OBD[/B][/QUOTE]


[SIZE=4][B]I want set open_basedir on php.ini for all account on server[/B][/SIZE]

Ex: /home/[B]username1[/B]:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp
 
Last edited:

Infopro

Well-Known Member
May 20, 2003
17,090
516
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
help me ...............................
I'm not sure what else can be done here, no reason to continue bumping the thread, the answers are here I believe. I can't comment on how directadmin does it, nor give you details on how to do it, like directadmin does it. The Documentation I've provided you links to should be what you seek. Please have another look at those and let us know whats not working for you when you do.