Search code examples
phpjsonapachelampmagento2

PHP Fatal error: Interface 'JsonSerializable'


I'm trying to install Magento2 on a new server LAMP setup. I am running the following:

  • Ubuntu Server 16.04
  • PHP 7.0
  • Apache 2.4

I keep getting a 500 error and when I refer to the logs I can see PHP Fatal error: Interface 'JsonSerializable' Not Found.

I have tried running apt-get install php-json and restarting Apache but this doesn't work. I have also tried enabling JSON using a2enmod json but i get an error saying the module doesn't exist.

I have been as far as page 3 on Google and found nothing that helps. Can anyone come up with something that I haven't already? I am officially at a loss.


Solution

  • I managed to get around this issue by simply purging everything PHP and reinstalling. I used sudo apt-get install php rather than specifying a version and it installed the exact same version as before.

    What is odd is that everything seems to be exactly the same as it was only this time it works.

    I suppose these things are sent to try us...