JSON Parse error: Unexpected EOF

JSON Parse error: Unexpected EOF

by Abdelmalek Nezzal -
Number of replies: 6

Hi,

On my localhost moodle 3.9 that I've installed with MAMP, I've this message only when I go to Dashboard , any Help:



Average of ratings: -
In reply to Abdelmalek Nezzal

Re: JSON Parse error: Unexpected EOF

by Ken Task -
Picture of Particularly helpful Moodlers

Similar problems reported already ... no way to replicate ... therefore no resolution.

So ... try this:

In your /Applications/MAMP/conf/php7.2.10 (which ever php version you have)
check php.ini for short_open_tag ... if Off turn On.

Terminal command located in above path:

fgrep 'short_open_tag' php.ini

If it shows:
; short_open_tag
short_open_tag = Off

Edit php.ini with nano ....
nano php.ini ... find the short_open_tag line and change it to:

short_open_tag = On

Save the php.ini file.

Restart your MAMP.

Fingers cross for ya!  Good luck!

'SoS', Ken

In reply to Ken Task

Re: JSON Parse error: Unexpected EOF

by Abdelmalek Nezzal -

Hi,

I've changed it to : short_open_tag = On , and restart but I've the same error message on the dashboard for all the commands on it 😀 What can I do next please.



In reply to Abdelmalek Nezzal

Re: JSON Parse error: Unexpected EOF

by Ken Task -
Picture of Particularly helpful Moodlers

Have you tried Googling for:
SyntaxError JSON Parse error: Unexpected EOF

https://www.google.com/search?q=SyntaxError+JSON+Parse+error%3A+Unexpected+EOF

Found in apps other than moodle ... and one won't find a link to MAMP/moodle using above sooooooo????


In the MAMP directory there is also a logs directory.
Contained therein, apache_error.log and a php_error.log
Now don't upload to these forums the entire log file.
Do look at them to see if you can find lines related to  accessing the Dashboard for a clue.

3.9 is right out of the shrink wrap ... so wonder if a minor update isn't already needed.   You might not know this but think MAMP can use git these days.

Let's check some things ... in terminal ... located in /Applications/MAMP/htdocs/moodle39

The commands:

fgrep '$release' version.php

What does that show?

Same location in terminal enter:

git branch -a

Yours should show:
* MOODLE_39_STABLE
  remotes/origin/MOODLE_39_STABLE

Haven't tried the following but if it works you can get minor updates ... the point releases to your version 3.9.0 or 3.9+ to sub versions like 3.9.1 or 3.9.2 etc.

With MAMP running
Same location in terminal:

git pull

Go back to the GUI MAMP refresh ... see if it upgrades.

Good luck!

'SoS', Ken


In reply to Ken Task

Re: JSON Parse error: Unexpected EOF

by Abdelmalek Nezzal -
Hi,
1-Contained therein, apache_error.log and a php_error.log:
There is no error on apache_error.log and php_error.log
2- I have only one terminal in MAMP called UpdateMoodle39.sh and when I run it :
mac@MacBook-Pro-de-mac ~ % /Applications/MAMP/UpdateMoodle39.sh ; exit;

+--------------------------------------------+
| GIT updater for your local Moodle server
+--------------------------------------------+

Already up to date.
[Opération terminée]

Regards
In reply to Abdelmalek Nezzal

Re: JSON Parse error: Unexpected EOF

by Ken Task -
Picture of Particularly helpful Moodlers

Please see:

https://tracker.moodle.org/browse/MDL-49719

There was a problem back then and appears you have same/similar problem now.    There was no way for anyone to replicate the issue, therefore no 'fix' forth coming.

The google link I shared indicates that error is not restricted to just Moodle alone ... other applications have similar issues.   Fixes one might find for other might apply to Moodle, but ... am not a programmer so have nothing to recommend.

Maybe other MAMP users can verify they have the same issue.

Good luck!

'SoS', Ken

In reply to Ken Task

Re: JSON Parse error: Unexpected EOF

by Abdelmalek Nezzal -
Hi,
Thank you for your assistance and more smile
I'll uninstall all the programs et reinstall them again perhaps it will work.
Regards
Abdelmalek