Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我在 1/2/3/file.php 之类的文件中包含一个文件并在文件中我这样做<?php include ('../file2.php'); ?>时,它会将我发送到:1/2/3/../file2.php
<?php include ('../file2.php'); ?>
1/2/3/../file2.php
它应该把我送到../file2.php。似乎它不使用 ../ 。该文件也确实存在。
../file2.php
尝试使用__DIR__
__DIR__
<?php include (__DIR__.'../file2.php'); ?>
<?php include (__DIR__.'../file2.php'); ?