Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Mar 2016
    Posts
    2
    Member #
    53679

    PHP file with HTML file extension does not run

    Hi,

    I hope I am asking my question in the right place.

    I have a PHP file which I would like to make my main website page. I renamed the php file made it "home.html" and placed in public html folder of my site using cPanel. For some reason I cannot run the PHP. I guess I need to tweek Apache config file but I am not sure what and where to change to make the PHP to run.

    Could you please help?

    Thank you!

  2.  

  3. #2
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    Apache most likely isn't passing the file to the PHP interpreter because it has a .html extension. Change the extension to .php
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."

  4. #3
    Junior Member
    Join Date
    Mar 2016
    Posts
    2
    Member #
    53679
    Thank you Ronald for your help.
    If i change php file extension back to PHP what should i have in home.html file?rat2 Something to call PHP? My web page consist of PHP file only at the moment.

  5. #4
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    Nothing. Just change the extension of the file.
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."

  6. #5
    Junior Member
    Join Date
    Mar 2016
    Location
    Chicago, IL
    Posts
    24
    Member #
    53671
    Liked
    8 times
    On Linux hosting you can change the filename to index.php, on Windows hosting it can be default.php, then the file will be processed automatically when anyone opens your URL.

  7. #6
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,686
    Member #
    5580
    Liked
    716 times
    Using .htaccess, you can tell the server to process .html files as .php

    I never like this idea, but it's an option if you choose.

    https://www.google.com/?gws_rd=ssl#q...ss+html+as+php



Remove Ads

Posting Permissions

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

Tags for this Thread

All times are GMT -6. The time now is 05:09 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com