I was running a simple XML parsing script which called one of the SimpleXML functions and PHP returned this error:

call to undefined function simplexml_load_file()

The solution I found was to just install the php-xml package like this:

sudo apt install php-xml

I didn't know I'd have to do that. But apparently the xml functions aren't installed on Linux Mint when you install just the PHP cli package.