Error when generating pdf file

I am current getting the following error when clicking the "download pdf button"

Fatal error: Call to undefined function mb_internal_encoding() in /home/ukclimbe/public_html/wp-content/plugins/user-reports/lib/dompdf/dompdf_config.inc.php on line 442

I have comment and post indexer installed and this is a wordpress multisite.

I also have 512M available so it cant be a memory issue.

Any ideas?

  • Paul

    @Ashley Keable, Sorry to hear about the error. The function is part of a PDF library we are using as part of User Reports. The user reports plugin simply include the library and the rest is done behind the scenes.

    So here are some suggestions/questions:

    2. The function in question should be located in a file <site root>/wp-content//plugins/user-reports/lib/dompdf/include/functions.inc.php Can you check your file system and make sure yo see this file.

    2. How did you install the User Reports plugin? Was this a manual download from the project page or was this within out WPMU DEV Dashboard? If you used the WPMU DEV Dashboard I would like to ask you to download the zip file and install manually from the project page. This way I can ensure all plugin files are on your system.

    Let me know.

  • Ashley Keable

    @PaulM Thanks for the fast response.

    I installed it through the dashboard but the file is present. However just to rule it out i have deleted and reinstalled manually as suggested. Unfortunately this has made no difference.

    There is 1 thing i can think of personally that may be causing the issue. My server is brand new and as such i have already had to install 1 or 2 php and apache extensions such as deflate and GD library.

    I was wondering is there anything that this relies on from a server point of view in order to generate the PDF?

  • Paul

    @Ashley Keable, Well that PDF library we are using should be generic enough to work in most any LAMP environment.

    There is nothing special about the way the library is included. Just a normal PHP include() call. Makes me think this is a path issue.

    To sort of think out loud on this.

    1. The plugin main file includes the library line 271
    require_once( dirname(__FILE__) . '/lib/dompdf/dompdf_config.inc.php');

    2. Inside the dompdf_config.inc.php file there is some setup to append a path variable to the current PHP path. This is somewhat common since there are many include files internal to the library.

    3. Line 93 of dompdf_config.inc.php includes the file functions.inc.php which contains the definition for the missing function.

    So again it appears the PATH is not properly being initialized. This is supposed to be automatic. Trying to dig into the code this afternoon.

    Can you tell me more about your setup:

    1. What version of Apache?
    2. Version of PHP

  • Ashley Keable

    @PaulM

    Sorry for taking so long to get back to you things have been hectic.

    Oddly enough this is now working perfectly. I have no idea what exactly fixed the issue however i was recently adding additional apache modules that were affecting my other site. These were "deflate", "GD Library" and a few others that i cant remember.

    I can only assume it was a missing module that was causing the issue. Anyway as its resolved i have closed the post.

    Thanks for the help anyway and keep up the good work.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.