Closed (fixed)
Project:
pclzip_zip_content_files
Version:
6.x-1.0-beta2
Component:
Miscellaneous
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Mar 2009 at 14:54 UTC
Updated:
3 Apr 2009 at 03:50 UTC
Hi There,
im getting this error everytime i try to download files .
* warning: tempnam(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/srv/www/htdocs/site102:/usr/local/php-bin) in /srv/www/htdocs/site102/sites/all/modules/custom/pclzip/pclzip.module on line 95.
* PCLZIP_ERR_READ_OPEN_FAIL (-2) : Unable to open archive '' in wb mode
I have had a look at line 95 in the code and can't seem to see where to make the changes.
My drupal default temporary folder was set to : /srv/www/htdocs/site102
Comments
Comment #1
ssm2017 Binder commentedhello
thank you for your report
the script is using the php function tempnam() http://php.net/tempnam
i dont know yet how to prevent this error
what php version are you using ?
is the user www-data have write / read access to this temp folder ?
Comment #2
tenx commentedPhp version 5.
The problem is that the module assume that the path to the temporary directory is "/tmp" or "../tmp", it then works fine . But when the path is changed to something other than "/tmp", it throws up that error.
Now i can't change the path myself because i have no access to installation files, and the dudes that host the site will not want to change the path .
So if there is way of stopping the module assuming that everyone will have their temporary file directory set as "/tmp", then i think the error will go away.
Comment #3
ssm2017 Binder commentedthe problem is not in this module
the problem is in the main module pclzip ( pclzip/pclzip.module on line 95. )
the php version should be >=5.2.1
as you can see in line 95 :
the function is using tempnam and also sys_get_temp_dir() http://php.net/sys_get_temp_dir
the module doesnt define nowhere that the temp dir has to be /tmp, this is automatically done by the php config
but your problem is not saying that the module cannot find the temp dir, the problem looks like a permission problem :
"warning: tempnam(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s)"
if you want, i can add the ability to add a custom temp folder in the admin options
or
try to replace :
with
Comment #4
tenx commentedOops forgotten there was two modules that allow this functionality. i should have checked the other module.The fix you provided up there seems to work. It now works w/o problems.
Although i noticed that when one creates a views of type file , this module doesn't work . i dont think it is supported .
Comment #5
ssm2017 Binder commentedthank you for testing, i will update the version to embed this modification
this module is only working for views type node
if you want you can build one for view type file
im waiting for your answer before trying to create one :)
Comment #6
tenx commentedit's all good.
Regarding building one for view type file, maybe once im done with this site im building, which wont be done till august or september.
I will keep reporting any errors with this one though.
Comment #7
ssm2017 Binder commented