nekudo/shiny_blog

PSR-4 Autoload error

sthesing opened this issue · 2 comments

I'd like to test-run locally with the built-in php webserver, but I ran into some trouble.

From within the shiny_blog-directory, I ran:
php -S localhost:8000

For the record: php version: PHP 7.0.18-0ubuntu0.16.04.1 (cli) ( NTS )

What works:

Pointing it to the following URLs works fine:

  • localhost:8000/blog
  • localhost:8000/blog/hello-world
  • localhost:8000/blog/category/news

What doesn't work:

Pointing the browser to the following URLs:

  • localhost:8000
  • localhost:8000/imprint

got me: PSR-4 Autoload error: File not found (Classname: DOMDocument).. In both cases, the server log reports a status code 500 for / and /imprint, respectively.

Pointing the browser to:

  • localhost:8000/blog/feed/

results in: PSR-4 Autoload error: File not found (Classname: SimpleXMLElement)

It doesn't seem to be a routing issue, or am I mistaken, there? Any ideas?

Seems like your php installation is missing the xml extension.

You can install by typing:

sudo apt-get install php7.0-xml

You might need to adjust the package name depending on your system.

Yes that helped, thanks for the quick answer.

In my installation, a dependency of parsedown-extra was missing, too.
So, on Ubuntu 16.04 at least,

sudo apt-get install php7.0 php7.0-xml php7.0-mbstring

satisfies all dependencies in order to run ShinyBlog on the built-in PHP-webserver.