0

We're getting this error in our test environment:

Parse error: syntax error, unexpected 'var' (T_VAR) in /home/usaspo5/public_html/dev/usgnew/components/com_usg_programs/tmpls/default.php

We have the same code on the live site and it does not produce these results.

6
  • Does your live site have errors turned on? Commented May 30, 2017 at 18:40
  • I do not believe so. Is there anyway around this. I need to be able to use that page for search feature testing Commented May 30, 2017 at 18:41
  • I turned off the error reporting and it did nothing for the issue on the test site Commented May 30, 2017 at 18:52
  • check the versions of PHP on each server Commented May 31, 2017 at 2:19
  • They're the same Server. So they have the same php version. I misspoke We use it as a test server but it's more of a test environment Commented May 31, 2017 at 12:44

1 Answer 1

0

It seems that you have a simple error. You have an extra quote or double qoute in your code like this:

"function(){"var x=jQuery('#id') "

In PHP you can only use var keyword in class to define variable! so, it seems that you have String break some were in js code within php file OR you did not close php tag like ?> before js code

3
  • Okay, would php asp code <%%> cause issues when using var? Commented Jun 1, 2017 at 18:00
  • According to php documentation the ASP tags <%, %>, <%=, and the script tag <script language="php"> are removed from PHP ver 7.0.0. If you use php ver 7 asp tags will not work Commented Jun 1, 2017 at 18:16
  • We are using 5.4.0 and <script type="text/html"> Commented Jun 1, 2017 at 18:51

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.