Warning: Unexpected character in input: '\' (ASCII=92) state=1

Warning: Unexpected character in input: '\' (ASCII=92) state=1

by Chris Eardley -
Number of replies: 0

Here's your fix if you're getting this sent to every hour since you installed moodle:

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/***/public_html/moodle/lib/setup.php on line 806

The latest Moodle needs PHP to be newer than 5.3.something, but even if you're running a compatible version you'll still get this error from the cron if your server is set to run an older PHP by default. What you need to do is force the cron to use the newer PHP too by changing the cron command to include something like '/opt/php54/bin/php -q' instead of just 'php -q'. The exact string depends on your server setup so ask your hosting company for the exact string.

Google "force cron jobs to use chosen php version" for more info.

Hope that saves someone some time and hair!

 

 

Average of ratings: Useful (2)