php / php/php-src

file_exists(): open_basedir restriction in effect

オープン
#8,402 コメント 6 件 リアクション 4 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Bug Category: Filesystem OS: Windows Status: Needs Triage
主要言語
C
スター
40.4k
フォーク
8.1k
平均マージ
2日 13時間
マージ済み PR(30日)
96

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、open_basedir を C:\Test に設定した Windows 上で file_exists() の例を再現し、PHP インタープリターが ? を含むパスをどのように処理するかを調べます。結果を期待される出力と比較します: open_basedir の警告なしで存在しない。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
c, php
領域
backend, operating-systems
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。