Jump to content

Override default temp directory in php


Recommended Posts

I am having problem with /tmp directory and i don't want it to be used as a default temp directory. We have a dedicated temp directory location and I wan to use it. I am getting the following error below:

 

 

SYSTEM WARNING: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/tmp/Juf3OS) is not within the allowed path(s): (/data/somelocation/)

SYSTEM WARNING: move_uploaded_file() [function.move-uploaded-file]: open_basedir restriction in effect. File(/tmp/tmpdpWiXN) is not within the allowed path(s): (/data/somelocation/)

 

My question is, how to override the default temp directory? Let's say i want to just declare /data/somelocation as my default temp directory.

Link to comment
Share on other sites

basically a certain plugin is using the default temp location and i do not have permission to change the php.ini file. i think it uses the sys_get_temp_dir but since no value for the TMP, TEMP and TMPDIR, the default /tmp was used. at least can i override these values so that i can assign a temp directory of my own, say /data/otherlocation?

Link to comment
Share on other sites

You probably need to add the path to your temp directory to your openbasedir list of allowed paths.

 

Sorry Doug, I'm a bit new with php, would you please let me know how can i do that? take note that i prefer to work on it on the code not on the server-side. but server admin let us allow to use /data/otherlocation as temp location.

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.