新安装xampp后出现PHP错误

I was recently switched computers at work, and am trying to get all my projects up and running again. I am working on testing some php/html/javascript pages for a website using a local xampp server. I had everything working properly on the only computer, but when I try to load the pages now I get the following error:

Uncaught SyntaxError: Unexpected token <

I have tried a php-only test page, so I know the sever is capable of parsing php.

I also know it is not the short tag issue, as all of the php code is wrapped in

<?php...?>

Are there any other configuration settings that would be causing this issue?

The error message doesn't look like a PHP error. Check this discussion maybe you can find the solution there.

It seems the error is reported by Google Chrome when it expects to parse a .js file and it finds HTML (or PHP?) instead.

I think it is a JavaScript error, you should check your js code, not php.

The following reasons might cause this error:

  1. href attribute value "javascript: void ()", no brackets add "0"

    <a href="javascript:void()">Button</a>  // error
    <a href="javascript:void(0)">Button</a> // correct  
    
  2. Non-compliant JSON string

  3. etc.