anevins Posted October 18, 2012 Share Posted October 18, 2012 Hello, I need to run my application on a server using PHP 5.2.4, but I'm running into troubles because I've been making it on a more recent version. I have these errors: Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /nas/students/a/a2-nevins/unix/public_html/year_4/dmp/app/controller/locations.php on line 23 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /nas/students/a/a2-nevins/unix/public_html/year_4/dmp/app/controller/locations.php on line 23 Parse error: syntax error, unexpected T_STRING in /nas/students/a/a2-nevins/unix/public_html/year_4/dmp/app/controller/locations.php on line 23 Line 23 is: $adapter = new \Geocoder\HttpAdapter\BuzzHttpAdapter(); How can I get around this? Thanks, Andrew Link to comment https://forums.phpfreaks.com/topic/269630-syntax-error-in-old-version-of-php/ Share on other sites More sharing options...
Christian F. Posted October 18, 2012 Share Posted October 18, 2012 Remove the namespaces, or upgrade your PHP version. That's the only two solutions to the problem. Link to comment https://forums.phpfreaks.com/topic/269630-syntax-error-in-old-version-of-php/#findComment-1386041 Share on other sites More sharing options...
White_Lily Posted October 18, 2012 Share Posted October 18, 2012 Just a little to add, the errors say "on line 23." This does not actually mean that the error is on that line. The error could of been caused anywhere above or below that line, however sometimes it is the specified line - maybe in future try posting the pages code, or the block associated with the errored line. Link to comment https://forums.phpfreaks.com/topic/269630-syntax-error-in-old-version-of-php/#findComment-1386042 Share on other sites More sharing options...
ManiacDan Posted October 18, 2012 Share Posted October 18, 2012 The code you're using relies on features only available in the newest version of PHP. Your code is not backwards-compatible, so you have to either stop using it or upgrade. Simply removing the namespaces is probably too difficult. Link to comment https://forums.phpfreaks.com/topic/269630-syntax-error-in-old-version-of-php/#findComment-1386044 Share on other sites More sharing options...
anevins Posted October 18, 2012 Author Share Posted October 18, 2012 Simply removing the namespaces is probably too difficult. Solved Link to comment https://forums.phpfreaks.com/topic/269630-syntax-error-in-old-version-of-php/#findComment-1386046 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.