L
L
l4m3r2018-12-05 11:42:18
PHP
l4m3r, 2018-12-05 11:42:18

Why does file_exists return false when the file definitely exists?

What can go wrong? The Test.txt file is on a different server (AD). file_exists returns false, but the file is opened through explorer. The user is the same.

file_exists('P:\Программы\Test.txt'); // false
file_exists('\\\\srv-01\Программы\Test.txt'); // false
// обе ссылки работают в проводнике

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Satisfied IT, 2018-12-05
@l4m3r

  • Try to remove the Russian names for the test, so that only the Latin alphabet is on the way.
  • Double-check if the web server is really running as the same user as you are running, and not from the system or something else.
  • Maybe you need to write the path like this:
file_exists('P:\\Программы\\Test.txt'); 
file_exists('\\\\srv-01\\Программы\\Test.txt');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question