Author Topic: Regarding open basedir error  (Read 626 times)

0 Members and 1 Guest are viewing this topic.

Regarding open basedir error
« on: January 22, 2018, 06:18:02 AM »
I'm using CWP-centos7. I'm trying to access my page using URL http://MYIP:2082/testone/test/index.php & its returning blank page with error

2018/01/22 05:34:26 [error] 32494#0: *3 FastCGI sent in stderr: "PHP message: PHP Warning:  include_once(): open_basedir restriction in effect. File(/var/sources/index.php) is not within the allowed path(s): (/home/testone:/tmp:/var/softtmp:/usr/local/cwpsrv/var/services/users:/usr/local/cwpsrv/var/services/user_files/modules:/usr/local/cwpsrv/var/services/twig:) in /usr/local/cwpsrv/var/services/users/test/index.php on line 6
PHP message: PHP Warning:  include_once(/var/sources/index.php): failed to open stream: Operation not permitted in /usr/local/cwpsrv/var/services/users/test/index.php on line 6
PHP message: PHP Warning:  include_once(): Failed opening '/var/sources/index.php' for inclusion (include_path='.:/usr/local/cwp/php71/lib/php:/var/sources/') in /usr/local/cwpsrv/var/services/users/test/index.php on line 6" while reading response header from upstream, client:, server: localhost, request: "GET /testone/test/index.php HTTP/1.1", upstream: "fastcgi://unix:/usr/local/cwp/php71/var/sockets/testone.sock:", host: ""

I have logged in as user called 'testone' (2082 port).
I have folder called 'test' & file named 'index.php' inside the dir -> /usr/local/cwpsrv/var/services/users/test/index.php
I have include my configuration in the file /usr/local/cwpsrv/conf.d/users.conf & below is my configuration

location /test {
    root /usr/local/cwpsrv/var/services/users;
    index  index.html index.htm index.php;
    rewrite ^/test/$ /test/index.php permanent;

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_read_timeout 600;
        fastcgi_pass    unix:/usr/local/cwp/php71/var/sockets/cwpsrv.sock;
        fastcgi_index   index.php;
        fastcgi_param   SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_param   SCRIPT_NAME   $fastcgi_script_name;
        include                 fastcgi_params;

    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
        access_log    off;
        log_not_found    off;
        expires 1M;

Can please tell me why its hitting 'open_basedir restriction error' every time ?
Please help me.

Thank You
kiran upadhya