Ended up being an issue with the font that was installed for use by the www-root user. Apparently the one that is used by default for Pygments was installed only for the user that I was running as when I use the command line.
The way I was able to figure this out, was running
exec("$command 2>&1", $out, $code);
.
The extra 2>&1
redirects stderr
into the output for me to see the issue.
The $out
parameter showed the FontNotFound error that pygments was throwing.
I changed the font that Pygments used via the command line using: full,style=manni,cssclass=pygmentize_kbOKBd,font_name='DejaVu Sans Mono' -l php -o /srv/www/path/to/images/uploads/2513732976ad4b7.02729290.png /tmp/pygmentize_kbOKBd
after finding which fonts I had available to me.
To see which fonts I had available to me as the user running the script, I just ran fc-list
in an exec()
command for Ubuntu, and checked the output of that for the list of available fonts.