Skip to content

Misleading note about move_uploaded_file() open_basedir awareness #11138

Closed
@tmsholy

Description

@tmsholy

The manual page: https://php.net/function.move-uploaded-file contains a note which states:

move_uploaded_file() is open_basedir aware. However, restrictions are placed only on the to path

While this is true, if the from path is not in open_basedir, the file is moved, but it generates a warning in the error log:

PHP Warning: move_uploaded_file(): open_basedir restriction in effect. File(/tmp/phpBxHkjL) is not within the allowed path(s): (/var/www/uploads/)

Tested on PHP 8.2.5

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions