|
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? |
|
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). |
|
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. |
|
Download PHP 5 to your comupter and install. HTML will work on your computer so no need to install Apache. |
|
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:
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 ' 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! Ok thanks for that advice ill change permissions. PHP works so ill try reinstalling Once again thanks for your help |
|
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. |


