2

It works perfectly in local host but when I upload it intothe server it has the following error:

Parse error: syntax error, unexpected T_STRING in D:\Hosting\4923367\html\beta\index.php on line 4

index.php:

<?php
include_once 'localization.php';
?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<!--Start Kampyle Exit-Popup Code-->
<script type="text/javascript">
var k_push_vars = {
    "view_percentage": 10,
    "popup_font_color": "#000000",
    "popup_background": "#D4E2F0",
    "header": "Your feedback is important to us!",
    "question": "Would you be willing to give us a short (1 minute) feedback?",
    "footer": "Thank you for helping us improve our website",
    "yes": "Yes",
    "no": "No",
    "text_direction": "ltr",
    "images_dir": "http://cf.kampyle.com/",
    "yes_background": "#76AC78",
    "no_background": "#8D9B86",
    "site_code": 9662374
}
</script>
<script type="text/javascript" src="http://cf.kampyle.com/k_push.js"></script>
<!--End Kampyle Exit-Popup Code-->

<!-- Start Kampyle Css -->
<link rel="stylesheet" type="text/css" media="screen" href="http://cf.kampyle.com/k_button.css" />
<!-- End Kampyle Css -->

(continues)

1
  • unless you are serving this with an application/xhtml+xml you don't need the prolog. And if you do, you should be aware of w3.org/MarkUp/2004/xhtml-faq#ie Commented May 12, 2010 at 15:47

4 Answers 4

13

<?xml is being mistaken for PHP short-tag, try echoing it ( although I don't see a need for it )

Sign up to request clarification or add additional context in comments.

Comments

4

The problem appears to be conflicting settings in the php.ini files on your respective servers. Try editing the php.ini file on your server and set

short_open_tag = 0

More information about the directives available in your php.ini file can be found here: http://php.net/manual/en/ini.core.php

2 Comments

This is the real solution, not encoding <?xml
or you could write: echo '<?xml version="1.0" encoding="utf-8" ?>';
2

Replace this

<?php
include_once 'localization.php';
?>
<?xml version="1.0" encoding="UTF-8"?>

with this:

<?php
include_once 'localization.php';
echo '<?xml version="1.0" encoding="UTF-8"?>';
?>

Comments

0

If you have access only to nginx site configuration, just add following string to your site config file (in section for php):

fastcgi_param PHP_ADMIN_VALUE short_open_tag=0;

And restart nginx.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.