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 10 of 10
  1. #1
    Regular Coder
    Join Date
    Oct 2010
    Posts
    272
    Thanks
    8
    Thanked 1 Time in 1 Post

    Help, Webpage is crashing on localhost

    If I view my page as a .html file on my computer, the layout looks fine and runs fine. If I view the file on the localhost as .html file it is also fine, but if I load the page as a .php file on the localhost server then the page crashes (extreme lag)and my web layout is all jumbled on the page?
    What should I do?

  • #2
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,364
    Thanks
    61
    Thanked 530 Times in 517 Posts
    Quote Originally Posted by andynov123 View Post
    What should I do?
    Show us the source code. There is no way we can help you fix it with a vague description you've given us
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • #3
    Regular Coder
    Join Date
    Oct 2010
    Posts
    272
    Thanks
    8
    Thanked 1 Time in 1 Post
    Does it matter if my PHP code is embedded in a html document. Since the localhost runs the .html file without crashing or having issues? Or does the file have to have a .php extension to run a PHP driven website?

  • #4
    Regular Coder
    Join Date
    Nov 2012
    Posts
    115
    Thanks
    7
    Thanked 12 Times in 12 Posts
    If you are trying to execute PHP code, the file extension needs to be .php.

    Unless you tell your server to handle .html files as a .php file by using MIME types, but that kinda defeats the purpose of descriptive file extensions...

  • #5
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,364
    Thanks
    61
    Thanked 530 Times in 517 Posts
    Quote Originally Posted by andynov123 View Post
    Does it matter if my PHP code is embedded in a html document. Since the localhost runs the .html file without crashing or having issues? Or does the file have to have a .php extension to run a PHP driven website?
    Again, if you're not going to show us your htaccess settings or source code how are we supposed to help?

    Yes you can put php code in a html page but your server must be configured to run html pages as php.

    You don't seem to know a lot about this so I can't help but wonder if your php is incorrectly setup or if you have code that is causing an error. Seeing as you refuse to show us there is not much we can really say to help you.
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • #6
    Regular Coder Redcoder's Avatar
    Join Date
    May 2012
    Location
    /dev/null
    Posts
    334
    Thanks
    2
    Thanked 48 Times in 47 Posts
    Make sure that the Apache module on your web server is properly loaded - green light blinks or whatever your Wamp Stack gives as feedback. Problems with the web server usually come up due to conflict with Skype which hogs port 80. Turn off Skype before starting up your Wamp Stack Software.

  • #7
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,364
    Thanks
    61
    Thanked 530 Times in 517 Posts
    I forgot about skype using port 80. I remember being annoyed by it moons ago but forgot about it. I always wondered why they chose to use a http port for TCP connections that are not http traffic? Seems a bit odd doesn't it.
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • #8
    Regular Coder Redcoder's Avatar
    Join Date
    May 2012
    Location
    /dev/null
    Posts
    334
    Thanks
    2
    Thanked 48 Times in 47 Posts
    Microsoft IIS and SQL Server Reporting services. SSRS apparently still runs even after uninstallation of SQL server.

    Yeah, its odd alright, that Skype uses Port 80 by default. But it can be disabled.


    Select Tools > Options > Advanced > Connection then uncheck “Use port 80 and 443 as alternatives for incoming connections”.

  • #9
    Regular Coder
    Join Date
    Sep 2012
    Posts
    100
    Thanks
    5
    Thanked 3 Times in 3 Posts
    I ran into the same problem years ago when I was starting out. My suggestions go along with what others have said..

    1.) check your configuration to assure proper setup.
    2.) disable all the extra BS that is running if it is not needed while you are testing (yahoo, etc are resource hogs)
    3.) Port conflict - That might be a problem, but if you're looking at files on the same machine via a web browser the port shouldn't matter as the browser is looking inside the network.

  • #10
    New to the CF scene
    Join Date
    Jan 2013
    Location
    mbeya - Tanzania
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by andynov123 View Post
    If I view my page as a .html file on my computer, the layout looks fine and runs fine. If I view the file on the localhost as .html file it is also fine, but if I load the page as a .php file on the localhost server then the page crashes (extreme lag)and my web layout is all jumbled on the page?
    What should I do?
    Would you send me that .html file so that I can check for you.
    Before you convert it to .php file, you should define php syntax at the top of the file itself.
    Eg.
    <?php

    //php scripts starts here

    ?>

    <html>
    <head><title>......</title></head>
    <body>
    <!-- Then proceed with you htm tags here -->

    </body>
    </html>


  •  

    Posting Permissions

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