login about faq

Due to the large amount of spam accounts, we temporarily disabled new user sign ups. To override this, email newuser.lgqa@gmail.com and an admin will determine if you are permitted to join


I am currently making a website for some people the pages are all PHP although they don't all contain it. However the layout only seems to show when loaded as an HTML file with the PHP code removed. It is running on a localhost server. Have you had this problem before? How did you fix it, if you have?

asked May 03 '11 at 14:45

DomChester's gravatar image

DomChester
391121625


You need to give more information. Also, PHP is a server side scripting language, meaning you won't see any PHP code on the client-side (for example, if you tried viewing the page's source in your browser).

answered May 03 '11 at 15:23

eddieringle's gravatar image

eddieringle
2.3k71644

You can google Apache or PHP and there will be instructions on how to download and setup Apache Server with support for PHP. Doing this will allow you to test your site completely without removing the PHP from your pages.

answered May 03 '11 at 15:48

David's gravatar image

David
3.3k112062

Download PHP 5 to your comupter and install.

HTML will work on your computer so no need to install Apache.

answered May 03 '11 at 17:46

Jackster1337's gravatar image

Jackster1337
8.5k178214300

Sorry I guess I explained this wrong - here are some screen shots: alt text

What it looks like!

alt text

what it should look like!

And I do have php running along with apache and MySQL

answered May 04 '11 at 14:24

DomChester's gravatar image

DomChester
391121625

edited May 04 '11 at 14:25

Looks like you don't have your stylesheets or images linked up correctly.

(May 04 '11 at 20:28) recck recck's gravatar image

yet they are working after changing it to .html?

(May 05 '11 at 12:26) DomChester DomChester's gravatar image

I can only think of two things:

1) You did not install php correctly.

But make sure it's working you can copy and paste this into a new .php file and see if it displays propperly:

<?php phpinfo(); ?>

If it does then php is working on your local server

2) If it does not work then there is probably something wrong with your php code or you need to re-install php.

Btw, running as root is a bit pew, pew. You should 'sudo chmod 777 /var/www' as standard user to gain permissions to this folder.

This is a bit picky of me, but you can do http://localhost/pagename.php to save constantly typing your IP, but i'm probably insulting you now!

answered May 04 '11 at 17:15

SignOff's gravatar image

SignOff
(suspended)

Ok thanks for that advice ill change permissions. PHP works so ill try reinstalling Once again thanks for your help

(May 05 '11 at 12:29) DomChester DomChester's gravatar image

It could be the file extension. If the file is index.php it will be able to parse html code as well as php code, if the file is index.html it will not be able to parse php code.

answered May 05 '11 at 10:52

Hugo's gravatar image

Hugo
1.7k243151

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported


Join Us in the Chat Room

Tags:

×537
×142
×96
×60

Asked: May 03 '11 at 14:45

Seen: 1,726 times

Last updated: May 05 '11 at 12:29