How can I remove open_basedir restriction only for one domain?

  • Hi there,


    I have installed i-mscp on a new server and finally I managed to install boxbilling. Now I have free hosting plans but I whould like to add advertisement all for free plans, but I need to edit the htaccess files for that automaticaly. I can do this only with a PHP script, but server say:

    Code
    1. Warning: file_exists(): open_basedir restriction in effect. File(/var/www/virtual/tesztelek.com/htdocs/.htaccess) is not within the allowed path(s): (/var/www/virtual/twebhosting.tk/:/usr/share/php/) in /var/www/virtual/twebhosting.tk/htdocs/public/cronol.php on line 24 Warning: file_put_contents(): open_basedir restriction in effect. File(/var/www/virtual/tesztelek.com/htdocs/.htaccess) is not within the allowed path(s): (/var/www/virtual/twebhosting.tk/:/usr/share/php/) in /var/www/virtual/twebhosting.tk/htdocs/public/cronol.php on line 30 Warning: file_put_contents(/var/www/virtual/tesztelek.com/htdocs/.htaccess): failed to open stream: Operation not permitted in /var/www/virtual/twebhosting.tk/htdocs/public/cronol.php on line 30


    Well I don't want to disabple open_basedir restrictions for all user and all domains, cos that could me me some problems. But for my domain it whould be great if that script could run.


    Is that possible to do this?

  • WARNING, it is not recommend to do this !!!


    you can edit the php.ini file for the user,
    for php-fcgi it is:
    /var/www/fcgi/THEDOMAINYOUWANT.TLD/php5/php.ini


    and add additional directories to open_basedir. e.g. /var/www or if you are crazy only / ;)


    EDIT:
    in your case, use /var/www/virtual

  • Thanks. I wont add /var/www/ :D


    Now I made a solutionI putted my script in the shared folder and run it from cronjob. Works like a charm.