Skip to content

file_exists(): open_basedir restriction in effect #8402

Open
@gold22

Description

@gold22

Description

The following code:

<?php
echo file_exists('C:\Test\test?') ? 'exists' : 'not exists';

Resulted in this output:

PHP Warning:  file_exists(): open_basedir restriction in effect. File(C:\Test\test?) is not within the allowed path(s): (C:\Test) in C:\Test\test.php on line 2
PHP Stack trace:
PHP   1. {main}() C:\Test\test.php:0
PHP   2. file_exists($filename = 'C:\\Test\\test?') C:\Test\test.php:2
not exists

But I expected this output instead:

not exists

PHP Version

PHP 7.4.x, 8.0.x

Operating System

Windows

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