open_basedir restriction in effect. File(/tmp/...) is not within the allowed path(s)

I have following entries in the error.log

[Fri Jan 19 20:10:12 2018] [error] [client myIP] PHP Warning:
filesize() [function.filesize]: open_basedir
restriction in effect. File(/tmp/phpE4uQRA) is not within the allowed path(s):
(/var/www/) in /var/www/www.example.com/zenphoto/zp-core/zp-
extensions/quota_manager.php on line 225, referer:
http://example.com/zenphoto/zp-core/admin-upload.php

[Fri Jan 19 20:10:12 2018] [error] [client myIP] PHP Warning:
move_uploaded_file() [function.move-
uploaded-file
]: open_basedir restriction in effect. File(/tmp/phpE4uQRA)
is not within the allowed path(s): (/var/www/) in
/var/www/www.example.com/zenphoto/zp-core/zp-
extensions/uploader_http/uploader.php on line 97, referer:
http://example.com/zenphoto/zp-core/admin-upload.php

[Fri Jan 19 20:10:12 2018] [error] [client myIP] PHP Warning: Cannot
modify header information - headers already sent by (output started at
/var/www/www.example.com/zenphoto/zp-core/zp-
extensions/quota_manager.php:225) in
/var/www/www.example.com/zenphoto/zp-core/zp-
extensions/uploader_http/uploader.php on line 120, referer:
http://example.com/zenphoto/zp-core/admin-upload.php

Is it possible that you "re-program" ZPC in that way that ZPC does not ask for access outside the webroot.
Like eg. /var/www/www.example.com/zenphoto/tmp/

Comments

  • acrylian Administrator, Developer
    edited January 2018

    Zenphoto does not ask for aynthing outside the webroot. Actually it only works within the webroot on the same server properly. It is techically possible to place the albums folder above the webroot to hide it but you would have to set this specifially in your config file manually.

    Those error messages seem to refer to tmp files which are actually a server internal thing that Zenphoto is not involved in. It should use what the server tells via the super global $_FILES.

    I am sure and sorry that you have this issue but I can only say I never encountered this anywhere so far and don't remember any reports in the past.

  • I found this: http://forum.zenphoto.org/discussion/comment/28215/

    I already spoke with the hoster and he is not keen of the idea of changing the server-settings. And he is advising me, not to ask him to do so.

    Thing is, that even I have upper entries in the error.log - the pictures were successfully uploaded and things look fine - except for the error messages in the frontend and entries in the log file.
    It's just that these entries will bloat the log files.

  • acrylian Administrator, Developer

    If setting the serverpath manually via the config as suggested on that old topic does not help, you can try it yourself via htaccess for example:
    https://stackoverflow.com/questions/13291185/open-basedir-how-to-set-for-specific-directory
    You can also try to overwrite the value in $_FILES somewhere.

    This seems a very specific, unusual error…

  • I am sorry that I've caused "some action" here with this topic.

    Our hoster did some investigating and found the source of the problem.
    It has/had nothing to do with ZPC - ZPC displayed it.
    Now he is just asking why it didn't have any effect on any other of our installations... :D

    Thanks so far.

  • acrylian Administrator, Developer

    No problem at all. Not all servers are the same or even the same configured. Glad you could solve it easily!

Sign In or Register to comment.