Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

PHP file sending me to error page when ran through server instead of executing.

I created a website that has a section of the pages ran through a PHP file but I don't know why it won't run on my server and pull up on my website. It shows a 404 File Not Found error. What do I need to support a PHP file on my server?

1 Answer

Luc de Brouwer
seal-mask
.a{fill-rule:evenodd;}techdegree
Luc de Brouwer
Full Stack JavaScript Techdegree Student 17,939 Points

Provide more information, at this point I can't tell what's wrong.

  • type of server : Apache / IIS / other
  • is any PHP module installed ? Apache : phpMyadmin IIS: PHP module

Make sure you are targeting the right file, does it have a the .php extension?

Error 404 indicates that the server cannot locate the file you are trying to open, check if that file exists or if the file doesn't exist in the folder/directory you are trying to locate. So make sure the correct references are made, check for typo's etc. Does the file exist in the directory?

if it is your localhost you could try something like

http://localhost/<folder>/<yourfilename.php>