![]() |
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? |
Quote:
|
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?
|
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... |
Quote:
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. |
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.
|
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.
|
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”. |
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. |
Quote:
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> |
| All times are GMT +1. The time now is 10:06 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.