PHP Confused

I placed it on my root dir but the php files did not work. I have contacted my server if they support PHP and they do. I copied and pasted it but nothing. I am using Firefox if that matters. My index page is here: www.scrumptiouscakes.co.uk/indexphp.php I have included the inc header and footer files and the about-us.php is there too but I just can't see the php part of it. I am using notebook too, I can't get wordpress to work either, it doesn't like firefox!! It feel like I'm banging my head against a brick wall sometimes. Sorry.
 
Here is the problem:
This is what is being outputted to the client, view the source of the page:
<?php require_once("inc/header.php");?>
<table> Home page content in here </table>
<?php require_once("inc/footer.php");?>


The PHP tags should never be outputted to the client if PHP is supported. PHP complies these and replaces them with the content you are referencing if it can not find it it outputs an error never the actual code. The problem is with the Server not compiling the PHP code.

Do you need to activate PHP in your CPanel perhaps?
They may support it but it may not be turned on by default.
But at the moment it is the server where it is failing and why you are ending up confused, the code should be fine. The server needs more investigation.

Check your CPanel for either activating PHP or adding PHP to your package I would say it is turned off by default. :)
 
Alternatively try include_once rather than require_once

It may not support require_once, that said if it didn't it would exist with a PHP fatal error not the actual code as PHP would have no idea what you where asking it to do, but something you could try.

I would be amazed if that resolved it though. :)
 
Well it sort of does as it's loading a PHP file, but then it doesn't appear to as it's just parsing the file like, not exactly as but like, a HTML file. Strange thing is if it was loading it as a HTML file the PHP sections should be outputted as well and be visible.

So yeah not sure. If it was working as it should that should have either loaded the includes, or existed with an error it shouldn't just display the PHP code tags and all. If it was not working and the page was being parsed as a HTML file then the code should display in the browser.

Either way something is not working and its not the code. Check with your server company/CPanel area. That would be a support thread form me if that was a work job.

That will also explain why your wordpress install is not working as it should, it aint you so put a bandage on that head. :)
 
Sadly not :( :( I just don't know what to do? There is no error code coming up. I know the servers supports PHP and you have kindly scripted a clean source so I am not to sure what is the next step??
 
I have contacted my server to look at the file and the PHP problem so hopefully I will get an answer. Hopefully in the next 24 hrs. Fingers crossed.
 
Mad idea but try the shorthand PHP syntax.
So replace all:
<?php

With just:
<?

But again it should be working fine with the none shorthand syntax.
 
Also create a seperate file and copy this in:

<?php
phpinfo();
?>

That will load everything about your current PHP setup. If it doesn't load everything view the source if you just see that line then its not being complied before being sent to the browser, which it should be.

Please note do not share this URL and delete after use it is not information you want people to read. Again if nothing loads then its a Server problem.

The simple test to make sure it is not is to write the most basic echo statement:

<?php
echo "Work god darn you";?>

If that doesn't out put work god darn you to the browser, but is viewable in the source its defo a problem with the server. The strange thing is you are not even getting 500 errors which is what I would expect to see - Server does not compute error
 
Tried that :( . Got this from an earlier contact from my server

"Scripting: support PHP, ASP, ASP.NET"

...so I know they DO support it. Very frustrating!!
 
Thanks, I think we are posting before the other has finished hehe. You say create a seperare file and copy this in:

<?php
phpinfo();
?>

What should the file be called???
 
Have you also tried shorthand syntax so the above would be:

<? echo "Work god darn you";?>

I have heard of it not compiling when shorthand syntax where used and shorthand is not supported, never the other way around though, that would be utterly mad. :confused:
 
Yeah I do that sorry, post and then go O how about this solution.
What ever you want.

one-more-follower-to-jaz.php

If you really want. Just don't let anyone know, and don't call it that as the info it will give you can be used by hackers to attack the server. As I say something random and don't keep it up for long. That would give you the info on whats supported and installed, don't say here it is and post a link to it either. :D
 
Getting a little confused now! I have placed the <? echo "Work god darn you";?> in the indexphp.php file and used require and once too.....sadly nothing. Above you asked me to create a separate file:
<?php
phpinfo();
?>
..but don't know what to call the file. The CP. Well I have looked around but now a little more confuse cos I am not too sure what I am looking for. I must sound like a headcase, but I am just a lost soul and very confused!?! :(
 
:lol: Don't worry.

Call it what ever you want as long as it ends in the PHP extension it really doesn't matter just DON'T let us know what you have called it due to the information it will show you. But if the shorthand didn't work, wait for support to get back to you TBH as both should.
 
I think I got what you meant...maybe! I called it ****.php and loaded that file in the browser but nothing came up, so it looks like wait for the server support at this point. Thanks so far!!!! :)
 
No worries,
View the source but I imagine it is just "outputting" the PHP code as all the others. Theres no reason from what I can see that shouldn't be working.
 
Back
Top