PHP files does not execute in windows machine

12,094

Solution 1

I had this and found that it was because the index.php file was set with encryption.

For anyone that wants to rule it out - right click the php file, select 'properties' then click the 'advanced' button and uncheck the 'Encrypt contents to secure data' check box and click 'O.K'. This worked for me, so just putting it out there.

Solution 2

In your cmd try to run your project with the following command

php -S localhost:8000 -t public

Solution 3

For me, the problem was that the requested file was in my OneDrive folder. I moved the DocumentRoot out of OneDrive and it all worked!

Solution 4

In my case index.php worked for other sites. To the site that had problems index.html file worked but not index.php. It caused the error message like in the first message of this thread.

The culprit was scandinavian 'ä' in the directory path of the site on Windows's file system of my site. I changed it to 'a' and restarted the server. That solved the problem.

Solution 5

I had the same problem with UwAmp. I solved it changing the name of a folder on my path, from Formación to Formacion, removing the accent mark, that seems to be a problem.

Share:
12,094
Ibrahim Azhar Armar
Author by

Ibrahim Azhar Armar

Bangalore, India.

Updated on June 05, 2022

Comments

  • Ibrahim Azhar Armar
    Ibrahim Azhar Armar almost 2 years

    i created the application in PHP on my mac osx. and after the development i zipped and transferred to the windows 7 machine. and when i tried opening it i get this error.

    Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0

    Fatal error: Unknown: Failed opening required 'C:/wamp/www/app/index.php' (include_path='.;C:\php\pear') in Unknown on line 0

    the above error suggest, the error is caused because of the file permission issue, is there any possible way i can fix this error in windows itself.?

    thank you..

  • michalzuber
    michalzuber about 10 years
    Thanks, it helped for WAMP on Windows to disable encrypting files It resolved the errors such as failed to open stream: No such file or directory and sometimes there was some SCREAM error
  • clarmond
    clarmond over 4 years
    I am having the same problem with OneDrive. I can move it to another folder and it works just fine but I wanted to keep it in OneDrive so that I could easily sync the code between my laptop and my desktop.
  • D. Pardal
    D. Pardal over 4 years
    Yeah, now OneDrive is better integrated with NTFS.
  • clarmond
    clarmond over 4 years
    I figured out how to get OneDrive to work with PHP. Go into the OneDrive settings and uncheck the "Files On-Demand" button. Then after everything has downloaded, it worked. What I think was happening was that PHP was requesting a file from OneDrive but only getting a zero-byte stub back. i.imgur.com/lukjm4n.png
  • Fadi Chamieh
    Fadi Chamieh about 4 years
    Thanks for the -t tip. In my case it was php -S 0.0.0.0:88 -t .!