I recently tried one too many things and had to re-flash the SDCard in my Raspberry Pi. Started over with Raspbian Stretch Lite. Added nginx, PHP7.0-fpm and a self-hosted social media service (Pleroma) and two basic web sites. I have typically used my /etc/hosts file to point my local browsing directly to the Pi's IP address. But now after copying back over some configuration files (from backup) and re-setting and re-configuring everything, I am unable to get to the two web sites. They constantly resolve to the social media site.

NOTE: These three sites were all working just fine and resolving separately before I had to reflash the SDCard...

Pleroma uses Elixir/Erlang/Phoenix, etc. It has its own service set up. It's working just fine, but if I type either of my other two domain names, they go to the social site. Example setup:

social.domain.com - running Pleroma myblog.domain.com - basic site travelblogdomain.com - basic site

Example configuration of one of the basic sites:

Server {
listen 80;
server_name myblog.domain.com;
root /var/www/html/myblog;
index index.php index.html index.htm;

location / {
  try_files $uri $uri/ /index.php$is_args$args;

access_log  /var/log/nginx/myblog.domain.com.access.log;
error_log   /var/log/nginx/myblog.domain.com.error.log;

# Deny direct access to .txt files
location ~* /bl-content/.*.txt$ {
    return 404;

location ~ .php$ {
    fastcgi_split_path_info ^(.+.php)(/.+)$;
    fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_intercept_errors off;
    fastcgi_buffer_size 16k;
    fastcgi_buffers 4 16k;

location ~ /.ht {
    deny all;

The nginx error log has a lot of these entries - at first they all show to be coming from my Ubuntu PC desktop:

2018/06/11 23:28:07 [error] 20756#20756: *239 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function mb_internal_encoding() in /var/www/html/glenn/bl-kernel/boot/init.php:71
Stack trace:
#0 /var/www/html/glenn/index.php(32): require()
#1 {main}
thrown in /var/www/html/glenn/bl-kernel/boot/init.php on line 71" while reading response header from upstream, client:, server: glenn.thedixons.net, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: ""

My PC is 1.72 - the Pi is 1.64

But the last several entries show the upstream client IP address to be different every time. Not sure if that means anything.

So I'm missing something somewhere, just not sure what....

1 Answer 1


You forgot to install, or at least enable, php-mbstring. Hint: "undefined function mb_internal_encoding()".

  • There were also a couple of other PHP modules that weren't installed. Good catch, thanks!
    – dixonge
    Jun 12, 2018 at 22:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.