Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jan 2005
    Posts
    189
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Basic php file question

    I've got 2 websites on different servers.

    One of them I can take an html file and just add .php as the extension and it will display the page no problem.

    The other site, I add .php and it will give me a 500 error (I tried setting permissions already).

    Is there something I need to set in apache or something?
    Basically I would like to have all my .html pages with a .php extension so I can add php in later - and I don't want to have to leave them as html and then change the URL's when I decide to go add php code and have anyone linking to my html files now have a broken links
    Last edited by a4udi; 11-18-2007 at 06:21 PM.

  • #2
    Regular Coder croatiankid's Avatar
    Join Date
    Jan 2006
    Posts
    665
    Thanks
    1
    Thanked 12 Times in 12 Posts
    Are you sure that server has PHP installed? Is it possible you have something in an .htaccess file that relies on the extension being .html? Sorry I can't be of more help.

  • #3
    Regular Coder
    Join Date
    Jan 2005
    Posts
    189
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Yes, I've got a form that uses php and that is working...

    I also tried coding the page using <?php echo " site content.... just to test it and that seems to work fine. Only thing is that I wanted to avoid having to do that to every page, because I am not adding any php right now... just want to have the page extensions ready for later.

  • #4
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,020
    Thanks
    2
    Thanked 313 Times in 305 Posts
    My guess is that the page contains <?xml and that php short open tags are enabled and you end up getting a fatal php parse error, giving the HTTP 500 page.

    Check your web server log for errors and/or turn on full php error reporting.

    You would need to post the content of the page to get specific help with what it might be doing that is causing the symptoms.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #5
    Regular Coder
    Join Date
    Jan 2005
    Posts
    189
    Thanks
    6
    Thanked 0 Times in 0 Posts
    You sir are a gentleman, and a scholar!

    It was a problem with the tags, all is well now! Thanks both for your help.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •