简体   繁体   中英

Why isn't my PHP code running on the production server?

I have tested my php code on my test server and everything worked fine, now I upload it to my web hosting on godaddy.com and each page works except one. The page simply outputs nothing, literally nothing

Out of frustration I put the following code on the production server

<BR>1
<? PHP
echo "<br>2";
?>
<BR>3

and this displays 1 & 3. Every other page of php code works on godaddy and this page works 100% of the time on the test server.

EDIT It seems to be comments are stopping it from working, when i delete the comments from the file it seems to work - but why? and how can I test this is actually the case?


It seems that the problem is the comments, wether I use the # or // to make comments it has stopped the code!

<?php
session_start();
include("../functions/common.php");
$sqldb = open_database();
include("../functions/create_game.php");
header('Location:'.$_SESSION['web_site'].'/home.php');  //Go back to the home page
?>

BUT, if I put comments on the end of any other line the code stops! I know this sounds strange but I have been working on it for over an hour and putting comments on and off to see if this is actually the problem.

I didn't see a reply to @Jack Maney's comment, so I'll repeat it.

Create a single file in httproot called info.php

Put the following line in that file:

<?php phpinfo();

View http://mysite.example.com/info.php (where mysite.example.com is your domain name). If you get nothing, then you'll need to get in touch with GoDaddy customer support, (480) 505-8877

尝试删除'php'之前的空格

is php in lowercase? <?PHP might not be recognized while <?php is standard

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM