Paralyzed by "open_basedir restriction in effect"

Discussion in 'Installation/Configuration' started by dpicella, Mar 16, 2010.

  1. dpicella

    dpicella New Member

    I know this issue has been posted, but something is strange here.

    I have 2 files:

    index.php
    Code:
    <?
      include('include.php');
    ?>
    
    include.php
    Code:
      phpinfo();
    
    I get ...


    Code:
    Warning: include() [function.include]: open_basedir restriction in effect. File() is not within the allowed path(s): (/var/www/clients/client1/web1/web:/var/www/clients/client1/web1/tmp:/var/www/sitename.com/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin) in /var/www/clients/client1/web1/web/index.php on line 3
    
    Fatal error: Can't load include.php, open_basedir restriction. in /var/www/clients/client1/web1/web/index.php on line 3
    
    The included file is clearly within the allowed paths ... so what's wrong? Weird!

    This is a fresh install of ispconfig 3 on a Fedora 12 machine.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Which PHP method do you use? Try to use php-fcgi + suexec.

    Also you can try to change the open basedir path to:

    /var/www/clients/client1/web1:/var/www/sitename.com:/usr/share/php5:/tmp:/usr/share/phpmyadmin
     
  3. dpicella

    dpicella New Member

    The only php method that seems to work is cgi

    Looking at /usr/local/ispconfig/server/conf/vhost.conf.master

    I noticed that only the standard php method includes the open_basedir paths.

    I put the following lines in vhost.conf.master under the cgi method and then set the path string to "none"

    That is the only thing that seems to work

    Code:
        php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -fwebmaster@<tmpl_var name='domain'>"
        php_admin_value upload_tmp_dir <tmpl_var name='document_root'>/tmp
        php_admin_value session.save_path <tmpl_var name='document_root'>/tmp
    <tmpl_if name='security_level' op='==' value='20'>
        php_admin_value open_basedir <tmpl_var name='php_open_basedir'>
    </tmpl_if>
    
    ???
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Please make sure that you disabled selinux in Fedora 12.
     
  5. dpicella

    dpicella New Member

    selinux has already been disabled. Any other thoughts?

    Code:
    # This file controls the state of SELinux on the system.
    # SELINUX= can take one of these three values:
    #       enforcing - SELinux security policy is enforced.
    #       permissive - SELinux prints warnings instead of enforcing.
    #       disabled - No SELinux policy is loaded.
    SELINUX=[B]disabled[/B]
    # SELINUXTYPE= can take one of these two values:
    #       targeted - Targeted processes are protected,
    #       mls - Multi Level Security protection.
    SELINUXTYPE=targeted
    
     
  6. rudisoft

    rudisoft New Member

    Hi everyone!

    Having the exact same problem unfortunately...
    I'm using ISPConfig 3.0.6 on a Fedora 12 perfect server setup.
    Disabling open_basedir seems to be the only solution so far.

    Hope someone will figure this one out :)
     

Share This Page