Jump to content

How do I check for: file_exists(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s):


Sonnich

Recommended Posts

Hi all

My code give this:

<b>Warning</b>:  file_exists(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/home/clients/........

I get the tmp folder and check for its existanse and whether it is writeable

$t=sys_get_temp_dir();
writelog("t=$t");
if(file_exists($t)) writelog("t1=YES"); else writelog("t1=NO");
if(is_writable($t)) writelog("t2=YES"); else writelog("t2=NO");

Both gives no which is fine, I can process that. I do it to avoid the output above, but I still get that.

How should I check for allowed paths?

This runs on several systems where I cannot access php.ini or other system stuff.

 

Link to comment
Share on other sites

I used PHP 11 years ago and I move my clients stuff. 

I dont see php.ini, not might I have access to it on my clients's ISP's systems.

Unless I can create php.ini myself and have it.

Sorry, I dont know much here. Some guidelines please....

Link to comment
Share on other sites

The temp dir really ought to be writable by PHP. You and/or your client should complain to the "ISP" or whoever manages their PHP setup to allow for that.

Worst case: write to someplace other than /tmp. Like a dedicated log directory for your application.

Oh. And this is something that should be configurable.

Link to comment
Share on other sites

8 hours ago, requinix said:

The temp dir really ought to be writable by PHP. You and/or your client should complain to the "ISP" or whoever manages their PHP setup to allow for that.

Worst case: write to someplace other than /tmp. Like a dedicated log directory for your application.

Oh. And this is something that should be configurable.

That will be my work around. My client want to move from this ISP to another, as there are other problems.

Usually once a year the do something and we have remind them about rights etc. It usually takes them a week and a daily mail to react.
After all, once I have copied their data out the will finish with this ISP

Link to comment
Share on other sites

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.