HTMLPurifier Serializer Error

February 19, 2018

Error:

Warning: Base directory htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer does not exist, please create or change using %Cache.SerializerPath in htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer.php on line XXX

Solution:

Create the directory Serializer located at htmlpurifier/library/HTMLPurifier/DefinitionCache/ and make sure it is server writeable.

cd htmlpurifier/standalone/HTMLPurifier/mkdir -p DefinitionCache/Serializer

If you're using a git you might want to add the directory to your repository.

Explanation:

The .gitignore file located at HTMLPurifier/ is set to ignore everything in the htmlpurifier/library/HTMLPurifier/DefinitionCache/ directory, and may cause the Serializer directory itself not to be created. More info about Cache.SerializerPath here: http://htmlpurifier.org/live/configdoc/plain.html#Cache.SerializerPath


Written By Dillon