Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-07-2013, 06:48 PM   PM User | #1
andynov123
Regular Coder

 
Join Date: Oct 2010
Posts: 246
Thanks: 8
Thanked 1 Time in 1 Post
andynov123 is an unknown quantity at this point
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?
andynov123 is offline   Reply With Quote
Old 01-07-2013, 06:55 PM   PM User | #2
tangoforce
Senior Coder

 
tangoforce's Avatar
 
Join Date: Feb 2011
Location: Your Monitor
Posts: 3,665
Thanks: 45
Thanked 456 Times in 444 Posts
tangoforce will become famous soon enoughtangoforce will become famous soon enough
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
__________________
Please don't be rude: Put your php code in [php][/php] tags. It is a sticky topic at the top of the forum and it HELPS us to HELP YOU!
TIP: Coding styles and $end errors :::::::::: TIP: Warning: Cannot modify header information - headers already sent :::::::::: TIP: Quotes / Parse error: syntax error, unexpected T_..
PHP Code:
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value. 
Explanation: The IE if(isset($_POST['submit'])) bug explained.
tangoforce is offline   Reply With Quote
Old 01-07-2013, 08:26 PM   PM User | #3
andynov123
Regular Coder

 
Join Date: Oct 2010
Posts: 246
Thanks: 8
Thanked 1 Time in 1 Post
andynov123 is an unknown quantity at this point
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?
andynov123 is offline   Reply With Quote
Old 01-07-2013, 08:42 PM   PM User | #4
Thyrosis
New Coder

 
Join Date: Nov 2012
Posts: 92
Thanks: 4
Thanked 12 Times in 12 Posts
Thyrosis is on a distinguished road
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...
Thyrosis is offline   Reply With Quote
Old 01-07-2013, 10:11 PM   PM User | #5
tangoforce
Senior Coder

 
tangoforce's Avatar
 
Join Date: Feb 2011
Location: Your Monitor
Posts: 3,665
Thanks: 45
Thanked 456 Times in 444 Posts
tangoforce will become famous soon enoughtangoforce will become famous soon enough
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.
__________________
Please don't be rude: Put your php code in [php][/php] tags. It is a sticky topic at the top of the forum and it HELPS us to HELP YOU!
TIP: Coding styles and $end errors :::::::::: TIP: Warning: Cannot modify header information - headers already sent :::::::::: TIP: Quotes / Parse error: syntax error, unexpected T_..
PHP Code:
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value. 
Explanation: The IE if(isset($_POST['submit'])) bug explained.
tangoforce is offline   Reply With Quote
Old 01-08-2013, 07:58 AM   PM User | #6
Redcoder
Regular Coder

 
Redcoder's Avatar
 
Join Date: May 2012
Location: /dev/couch
Posts: 309
Thanks: 2
Thanked 46 Times in 45 Posts
Redcoder has a little shameless behaviour in the past
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.
__________________
For professional Hosting and Web design.....


NetEssentials.co.uk
Redcoder is offline   Reply With Quote
Old 01-08-2013, 10:47 AM   PM User | #7
tangoforce
Senior Coder

 
tangoforce's Avatar
 
Join Date: Feb 2011
Location: Your Monitor
Posts: 3,665
Thanks: 45
Thanked 456 Times in 444 Posts
tangoforce will become famous soon enoughtangoforce will become famous soon enough
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.
__________________
Please don't be rude: Put your php code in [php][/php] tags. It is a sticky topic at the top of the forum and it HELPS us to HELP YOU!
TIP: Coding styles and $end errors :::::::::: TIP: Warning: Cannot modify header information - headers already sent :::::::::: TIP: Quotes / Parse error: syntax error, unexpected T_..
PHP Code:
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value. 
Explanation: The IE if(isset($_POST['submit'])) bug explained.
tangoforce is offline   Reply With Quote
Old 01-08-2013, 11:06 AM   PM User | #8
Redcoder
Regular Coder

 
Redcoder's Avatar
 
Join Date: May 2012
Location: /dev/couch
Posts: 309
Thanks: 2
Thanked 46 Times in 45 Posts
Redcoder has a little shameless behaviour in the past
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”.
__________________
For professional Hosting and Web design.....


NetEssentials.co.uk
Redcoder is offline   Reply With Quote
Old 01-08-2013, 02:24 PM   PM User | #9
Ctechinfo
New Coder

 
Join Date: Sep 2012
Posts: 90
Thanks: 3
Thanked 3 Times in 3 Posts
Ctechinfo is an unknown quantity at this point
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.
Ctechinfo is offline   Reply With Quote
Old 01-08-2013, 02:55 PM   PM User | #10
amb.godwin
New to the CF scene

 
Join Date: Jan 2013
Location: mbeya - Tanzania
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
amb.godwin is an unknown quantity at this point
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>
amb.godwin is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:09 AM.


Advertisement
Log in to turn off these ads.