Jump to content

[SOLVED] PHP.ini & Access restriction


EagerWolf

Recommended Posts

Hello!

 

I have tried to restrict access using PHP.ini - openbase_dir... I have archived, that php was executed only in certain directory. So let's say we have got index.php with path: "C:/Web/www/"...

 

I set openbase_dir = "C:/Web/www/"

 

Fine index.php was accessible and worked fine. I tried to run another file in "C:/Web/www/dir1/" and file didn't execute. Perfect!

But when I tried to include file in dir1 into index.php I got error...

 

Thanks for your help!

Matija

Link to comment
https://forums.phpfreaks.com/topic/97870-solved-phpini-amp-access-restriction/
Share on other sites

I set openbase_dir = "C:/Web/www/"

When using openbase_dir dont end paths with slashes. Use:

openbase_dir = "C:/Web/www"

 

This will allow PHP to parse php files in C:/Web/www and all subdirectories. if you set openbase_dir it to C:/Web/www/ (forwardslash at the end) you only allow access files contained in C:/Web/www it wont parse files in subdirectories.

  • 4 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.