When I go to create a new node, change the input type to "Asset", and click "Insert Assets", the pop-up window shows this following error message:
* warning: realpath() [function.realpath]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/www/00dfc27b839d9b2dc803b9e7f3aa44c4:/tmp:/opt/php/lib/php) in /home/www/00dfc27b839d9b2dc803b9e7f3aa44c4/web/newsite/includes/file.inc on line 286.
* warning: realpath() [function.realpath]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/www/00dfc27b839d9b2dc803b9e7f3aa44c4:/tmp:/opt/php/lib/php) in /home/www/00dfc27b839d9b2dc803b9e7f3aa44c4/web/newsite/includes/file.inc on line 286.
I don't know much about the configuration of the server this is on, however I do know that Asset module should handle open_basedir restrictions properly, as this is a fairly common thing for administrators to do on their servers.
Why does Asset need access to directories below the user's home directory?
Comments
Comment #1
jmlane commentedThis error is still happening, but I can hide it to the logs.
Asset 'seems' to be working fine, but I am curious about what might be causing this error message?
Comment #2
wmostrey commentedHey Jonathan, I'll do some testing to see if I can replicate this. Asset doesn't try to access any files outside the web directory so it should be playing nicely with open_basedir restrictions (if they are correctly set of course, which they appear to be in your case). I think this is happening because asset is trying to check "/", by which Drupal's base_path is meant of course, not the root of the server.
Comment #3
jmlane commentedEvery time the Asset UI is called at http://mysite.org/asset/wizard/tinymce, I get this same old PHP error in my logs:
realpath() [<a href='function.realpath'>function.realpath</a>]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/www/00dfc27b839d9b2dc803b9e7f3aa44c4:/tmp:/opt/php/lib/php) in /home/www/00dfc27b839d9b2dc803b9e7f3aa44c4/web/newsite/includes/file.inc on line 286.I am having problems with the Asset UI as well, which I am assuming are part of this problem seeing as nobody else seems to have reported them:
Any ideas if these issues are related, and even if not, any suggestions for the problems?
Thanks for all your help,
Jonathan M. Lane
OpenConcept Consulting Inc. http://www.openconcept.ca/
Comment #4
mfer commentedThis has to do with sections of code like:
What happens when $asset->dirname is empty? You try to create a path at '/filename' which is outside of the allowed area. This throws the error.
I have a workaround for this. (Sorry, I have not had a chance to roll a patch for this yet.)
In asset_load of asset.module after the db_object_fetch and the check to make sure something loaded add the line that tests dirname and adds the / if it exists.
Then modify the filepath and url to look like:
A similar solution is needed where ever $form_values['parent'] is used with file_create_path. $form_values['parent'] may be empty.
Is it a good approach to modify $asset->dirname and $form_values['parent'] or should a new variable be created as a temp variable instead of the modification? Or should an if statement be used with:
????
Comment #5
mfer commentedI noticed this same problem in asset_bonus for embedded objects. Haven't traced the cause of it yet.
Comment #6
mfer commentedI have the problem in the 1.0-beta1 release. I'll roll a patch in the next day or so.
Comment #7
mfer commentedAttached is a patch that removes this error for me.
Comment #8
mfer commentedI'm moving this over to bugs and upping the priority to critical. If you don't have your directory structure setup (for example a first tie install) you will get these errors because there is no root dirname.
Comment #9
wmostrey commentedCommitted to dev, thanks so much! You just brought Beta 2 a lot closer.
Comment #10
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.