-3

I'm getting this error from host server:

Warning: Unknown: open_basedir restriction in effect. File(/www/zxq.net/k/u/p/kuptoje/htdocs/index.php) is not within the allowed path(s): (VIRTUAL_DOCUMENT_ROOT) in Unknown on line 0

Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0

Fatal error: Unknown: Failed opening required '/www/zxq.net/k/u/p/kuptoje/htdocs/index.php' (include_path='.:/usr/lib/php') in Unknown on line 0
000
  • 26,951
  • 10
  • 71
  • 101
Diar Selimi
  • 71
  • 1
  • 1
  • It's a webserver misconfiguration or your `index.php` is placed in wrong directory. – ElmoVanKielmo Jul 02 '13 at 14:05
  • I fail to see what your question is. This is not a debugging site; ask a more general question and provide more information. Right now all we know is that there is this error coming up. What operation were you trying to perform? – PixelArtDragon Jul 02 '13 at 14:06
  • Do you have access to the server via ssh? Do you have root privileges? Is it your server or you use hosting? – ElmoVanKielmo Jul 02 '13 at 14:07
  • @Garan, it is irrelevant what operation he is trying to do on webpage - his php script is outside VIRTUAL_DOCUMENT_ROOT. – ElmoVanKielmo Jul 02 '13 at 14:09

1 Answers1

1

Some hosts set an open_basedir restriction. This means that only files from inside the set include_path are allowed.

your include_path is set to '/usr/lib/php' but you are trying to require a file from '/www/zxq...' and that is not in the allowed include_path.

Solutions are to set open_basedir off or to add your '/www' folder to the open_basedir include_path. this should be done in your php.ini file (often located at /etc/php.ini) There you simply add the /www directory to you php.ini file. e.g. include_path='.:/usr/lib/php:/www/zxq.net'

If you don't have access to your php.ini file you can try setting it in php: http://php.net/manual/en/function.set-include-path.php if that doesn't work they don't allow you to edit the include_path. Contact your host and let them fix the problem.

EDIT: as linked to in the comments. See this thread for more info: open_basedir restriction in effect. File(/) is not within the allowed path(s):

Community
  • 1
  • 1
Pinoniq
  • 1,365
  • 9
  • 13