Jump to content

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...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.