简体   繁体   English

Uncaught SyntaxError: Unexpected token < 错误信息

[英]Uncaught SyntaxError: Unexpected token < error message

I am trying to find the solution for the error: Uncaught SyntaxError: Unexpected token <我试图找到错误的解决方案: Uncaught SyntaxError: Unexpected token <

From googling, I found that its about code error.通过谷歌搜索,我发现它是关于代码错误的。 So, I went to look at the line it is causing the error.所以,我去看了导致错误的那一行。

<?
$file = file_get_contents('js/book.js', true);
echo $file;
?>

This code used to work, however, after we cleaned the server, we are coming across this issue.这段代码曾经可以工作,但是,在我们清理服务器后,我们遇到了这个问题。

So what I tried所以我试过的

<?php 
$file = file_get_contents('js/book.js', true);
echo $file;
?>

and that causes a new error HTTP ERROR 500 .这会导致新的错误HTTP ERROR 500

I am extremely confused on how php can even start as <?我对 php 如何以<? and not the usual way of <?php而不是<?php的通常方式

Is there any point that I have to look out for?有什么需要我注意的地方吗?

I found out the reason, it is because of my php version.我找到了原因,是因为我的 php 版本。 Had to upgrade it.不得不升级它。 Also, had to change the php code of connecting to the database.另外,必须更改连接到数据库的php代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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