Xampp not displaying PHP pages in htdocs due to "failed to open stream: Permission denied"

53,294

Solution 1

What system are you using, Win, Mac or Linux? On Mac when I try http://localhost/ it redirects to http://localhost/xampp/ and then there's the default welcome page.

Also, if you put you page(s) in a folder (abc_folder/index.php for example) under htdocs, you'll have to call it http://localhost/abc_folder/index.php

Solution 2

You may have error reporting turned off in your php.ini file, and it could be something like a database error causing your pages to blank.

I would suggest putting this code into test.php and navigating to it.

<?PHP
    phpinfo();
?>
Share:
53,294

Related videos on Youtube

Stephen Ostermiller
Author by

Stephen Ostermiller

Updated on September 18, 2022

Comments

  • Stephen Ostermiller
    Stephen Ostermiller over 1 year

    I installed xampp this evening and none of my PHP pages will display. I am storing all my pages in the htdocs folder as directed too and calling via http://localhost/index.php and nothing appears? All systems are online. Is there anything else that should have been done before copying over my pages?

    i'm using a MAC. I've tried putting my files in there in another file aswell but nothing displays! I get this error:

    Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0
    Fatal error: Unknown: Failed opening required '/Applications/XAMPP/xamppfiles/htdocs/XXXXXXX/index.php' (include_path='.:/Applications/XAMPP/xamppfiles/lib/php:/App‌​lications/XAMPP/xamp‌​pfiles/lib/php/pear'‌​) in Unknown on line 0

    Any ideas? Very new to PHP and Xampp!

    • Admin
      Admin almost 13 years
      What is C:\xampp\htdocs\index.php ?
  • Admin
    Admin almost 13 years
    Thank you, i'm using a MAC. I've tried putting my files in there in another file aswell but nothing displays! I get this error: Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0 Fatal error: Unknown: Failed opening required '/Applications/XAMPP/xamppfiles/htdocs/XXXXXXX/index.php' (include_path='.:/Applications/XAMPP/xamppfiles/lib/php:/App‌​lications/XAMPP/xamp‌​pfiles/lib/php/pear'‌​) in Unknown on line 0
  • vector
    vector almost 13 years
    ... did you make sure file permissions are set correctly? Did you try a simple 'Hello World' example first?