open_basedir restriction in effect

Discussion in 'Installation/Configuration' started by parkerj, Mar 19, 2014.

  1. parkerj

    parkerj Member

    I have Amazon s3 sdk installed through pear, and I am getting tons of errors like the following. Can someone give me guidance on how to fix or what I should add in the open basedir setting for a particular site? Or if there is a way to suppress it for the sdk only, probably would work better, I suppose. Thanks.

    Code:
    file_exists(): open_basedir restriction in effect. File(/usr/share/pear/Guzzle\Common\AbstractHasDispatcher.php) is not within the allowed path(s): (/var/www/clients/client1/web2/web:/var/www/clients/client1/web2/private:/var/www/clients/client1/web2/tmp:/var/www/demo.example.net/web:/srv/www/demo.example.net/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin)
     
    Last edited: Mar 19, 2014
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    add:

    /usr/share/pear/

    to the open_basedir path of the website, separated by : from the other paths.
     
  3. parkerj

    parkerj Member

    Added, but...

    Ok, I added /usr/share/pear/: as you suggested but I am still get 154 error messages. Any other suggestions? Thanks.

    Code:
    file_exists(): open_basedir restriction in effect. File(/usr/share/pear/Aws\S3\S3Client.php) is not within the allowed path(s): (/usr/share/pear/:/var/www/clients/client1/web2/web:/var/www/clients/client1/web2/private:/var/www/clients/client1/web2/tmp:/var/www/demo.example.net/web:/srv/www/demo.example.net/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin)
    I should also mention that PHP namespaces seems to be involved in this error as well and that I am the only person who is allowed to use FTP and shell if somehow that may be a factor in figuring out the correct solution for this.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Try to remove the / at the end of the path, not sure if this affects php:

    /usr/share/pear:/var/www/clients/client1/web2/web:/var/www/clients/client1/web2/private:/var/www/clients/client1/web2/tmp:/var/www/demo.example.net/web:/srv/www/demo.example.net/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin

    and the files that you try to access must be owned by the user and group of the website, when you use php-fcgi, php-fpm. cgi with suexec or suphp. otherwise php / suexec will not be able to access the file due to permission errors.
     
  5. parkerj

    parkerj Member

    I tried it both ways, with and without the "/" and still the same issue. I am using Nginx with PHP5-FPM, ubuntu 13.04. Also, here is what I get when I do ls -la /var/www/clients/client1/web2/web in case this helps:

    drwx--x--- 9 web2 client1 4096 Mar 19 13:13 .
    drwxr-xr-x 18 root root 4096 Mar 19 04:06 ..
    drwxr-xr-x 3 web2 client1 4096 Mar 19 04:08 api
    drwxr-xr-x 7 web2 client1 4096 Mar 19 04:08 eduTrac
    drwxr-xr-x 2 web2 client1 4096 Mar 19 04:20 error
    -rw-r--r-- 1 web2 client1 1150 Mar 19 04:08 favicon.ico
    drwxr-xr-x 8 root root 4096 Mar 19 04:08 .git
    -rw-r--r-- 1 root root 188 Mar 19 04:08 .gitignore
    -rw-r--r-- 1 web2 client1 1751 Mar 19 04:08 index.php
    -rw-r--r-- 1 web2 client1 3330 Mar 19 04:08 install.sh
    -rw-r--r-- 1 web2 client1 9878 Mar 19 04:08 LICENSE.txt
    -rw-r--r-- 1 web2 client1 25 Mar 19 04:08 robots.txt
    drwxr-xr-x 5 web2 client1 4096 Mar 19 04:08 static
    drwxrwxrwx 2 web2 client1 4096 Mar 19 13:13 .tmb
    drwxr-xr-x 6 web2 client1 4096 Mar 19 04:08 tmp
     

Share This Page