FATAL ERROR: No such file or directory in Unknown on line 0

Asked

Viewed 4,159 times

2

After the system upgrade (to Windows 10 1709) started giving the following error in running PHP:

Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0

Fatal error: Unknown: Failed opening required 'D:\...\index.php' (include_path='C:\xampp\php\pear') in Unknown on line 0

This happens if you use php’s Built-In (php -S 0.0.0.0:80) how to use the apache XAMPP service.

However, if you run the same drive C project: (drive where XMPP is installed) the error does not occur.

Can anyone explain why this behavior?

Obs: Note that the error is in the file Unknown on the line 0... ie, it gets completely lost. Also note that the error did not occur before Windows update. The error did persist after the reinstallation of XAMPP

  • It can also be by the name of the PHP file, which cannot have special characters (accents, commas, etc).

  • Thank you @Filipefernandes but, as you can see in the example, no special characters are used. The reason, as shown in the accepted answer below, is another

1 answer

2


How it was working before the upgrade, must be something to do with this.

This type of error usually occurs when Apache or PHP does not have access to the project folder/files.

It may be that in the update the permissions of the drive D or project folder (or some folder from which it inherits) has been changed.

To check this, right-click the project folder, property, security tab, and click Advanced. There you can see permissions and ownership of the folder.

Another possibility would be the Onedrive. In Windows 1709 it has improved behavior (due to sending on demand) and needs larger permissions in the folder where it acts.

If you have Onedrive active, and your project folder is on it, you won’t be able to use the built-in on it and neither will Apache (at least until Microsoft resolves this, if they will).

If this is the case, I recommend that you put your project off the Onedrive and send there only the final versions of each update. So vc keeps your linked files without losing ownership of the folder. (Until pq, if you use some versioner, such as Git, it is not much recommended to have Onedrive, Google Drive, or qq/other active cloud storage in the same folder, because the versioner updates multiple files to each commit, and the application that stores in the cloud may get lost.

I hope I’ve helped.

  • 1

    It was really Onedrive... thank you very much!

  • After making brew upgrade started to give this problem in a PHP project. Solutions? I have nothing in One Drive and tou num macOS @Kamile Pimenta

Browser other questions tagged

You are not signed in. Login or sign up in order to post.