我是否必须在移动设备上使用不同的PHP?

This is my first PHP-based web project. I have the web part of it working perfectly, but I'm having trouble with the mobile version. (Web hosting on godaddy linux)

What is the reason for my .php page not displaying? If I change it to .html, it works fine. (I suspect the doctype, but not sure.) Not sure if this code is necessary, but I'll leave out the body for the sake of space:

<?php include_once 'web/config.php'?>
<!DOCTYPE HTML>
<html>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
"http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>About - Mobile</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="keywords" content="About - Mobile" />
<link href="css/style.css" rel="stylesheet" type="text/css"  media="all" />
</head>

config.php:

$link = mysqli_connect($server, $db_user, $db_pass);
mysqli_select_db($link, $database);

// -=-=-=-=-=-=-=[ Getting Variables ]=-=-=-=-=-=-=- //
$query = "SELECT * FROM `misc`";
$result = $link->query($query);
while($info = mysqli_fetch_array($result)){
// -=-=-=-=-=-=-=[ Variables ]=-=-=-=-=-=-=- //
$pickupTime = $info['pickupTime'];
$deliveryTime = $info['deliveryTime'];
$minDeliveryPrice = $info['minDeliveryPrice'];
$Gtitle = $info['Gtitle'];
$emailAccount = $info['emailAccount'];
$phone = $info['phone'];
$mailSubject= $info['mailSubject'];
$address = $info['address'];
$city = $info['city'];
$zipcode = $info['zipcode'];
$companyTel = $info['companyTel'];
$companyEmail = $info["companyEmail"];
$facebookLink = $info['facebookLink'];
$twitterLink = $info['twitterLink'];
$googleLink = $info['googleLink'];
$termsOfService = $info['termsOfService'];
}
?>

Thanks in advance!

PHP is executed at server side, as long as the PHP script renders valid HTML (this however doesn't seem the case), the phones won't care.

In case PHP code is received by a browser, something is wrong with the sever (for instance you didn't install PHP at server side, or the webserver doesn't know when to call PHP to generate a webpage)

A browser never receives the PHP code (otherwise it would be easy for instance to hijack databases since the PHP code has somehow the password).

PHP executes on the server, the client doesn't know it is talking to PHP. You need not change PHP code when targeting mobile platforms.

Your issue appears to be corrupt HTML

<?php include_once 'web/config.php'?>

We should probably see the config.php file to see what is happening in there.

<!DOCTYPE HTML>
<html>

Here you open an <HTML> tag.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
"http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

Here you open another <HTML> tag, this is an issue. You should only have one <HTML> tag as your outer node in the document.

<head>
<title>About - Mobile</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="keywords" content="About - Mobile" />
<link href="css/style.css" rel="stylesheet" type="text/css"  media="all" />
</head>

You do not close your <HTML> tags and you do not have a body to render.

Well since you said you posted only the head. Im just gonna fix your html to at least make it valid. And regarding the php, other answers explain why php doesn't matter when viewing websites in browsers

<?php include_once 'web/config.php'?>
<!DOCTYPE HTML>
<html>
    <head>
        <title>About - Mobile</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <meta name="keywords" content="About - Mobile" />
        <link href="css/style.css" rel="stylesheet" type="text/css"  media="all" />
    </head>
    <body>
    ....
    </body>
</html>

If this doesn't work, then I am guessing that this line of php <?php include_once 'web/config.php'?> is outputting something which is messing up the html or in other words, make it invalid, so try removing it and then try

Also what do you mean its not displaying? Like nothing shows up? Or does it give an (http and or php) error?