You need to adjust php's include_path to contain `%%DATADIR%%/lib'! For example, insert include_path = ".:%%DATADIR%%/lib" into `%%LOCALBASE%%/etc/php.ini'.