We have got the latest PHP version on Hostsharing, and Knowledge Tree did not work anymore.

I got a long list of deprecated warnings, and the session would not even start, so not even a login screen is displayed.
Deprecated: Assigning the return value of new by reference is deprecated
Warning: The magic method __get() must have public visibility and cannot be static
Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent
The solution is to edit config/dmsDefaults.php, find the lines containing
error_reporting(E_ALL & ~E_NOTICE);
ini_set(‘display_errors’, ‘1’);
ini_set(‘display_startup_errors’, ‘1’);
Below that, add the following line:


Now Knowledge Tree will work again, and hopefully the next version of Knowledge Tree will have fixed all the deprecated PHP things.
Knowledge Tree and PHP 5.3.3
Tagged on:     

7 thoughts on “Knowledge Tree and PHP 5.3.3

  • March 14, 2011 at 11:45 pm

    Thank you. Made my night a couple of hours longer.

    How did you find out?



    BTW: If the wizard doesn’t let you install KT on php 5.3 just change a line in /setup/wizard/steps/dependencies.php

    change phpversion to 5.4 or something. 🙂

  • April 16, 2012 at 1:31 pm

    Hi I have followed your tip on my PHP 5.3.10 server but now on


    I get a blank screen 🙁

    Can you advise? Thanks!

  • April 16, 2012 at 1:44 pm

    a blank screen is usually a sign for a typo. Check your changes again. Otherwise modify your php.ini to show errors (display_errors = On), which might help you to find the line of your typo.

  • April 17, 2012 at 4:19 pm

    Hi I have double checked the edit. When I remove the line


    I will get output on the page like this:

    Deprecated: Assigning the return value of new by reference is deprecated in etc etc etc

    I definitely don’t have a typo – when I put it back in, the whole screen shows a blank 🙁

    I did a

    tail -f /var/log/messages

    and reloaded the page (and get a blank)
    but it does not show any errors

  • April 17, 2012 at 8:44 pm

    You can also try to use error_reporting(E_ERROR);
    see also http://php.net/manual/en/function.error-reporting.php for possible parameters.

    On the other hand, I am quite disappointed with KnowledgeTree, since it seems they are not developing the community version anymore. See also this thread: http://forums.knowledgetree.org/viewtopic.php?f=3&t=20951

    I am personally considering to try Alfresco, but I have not found an easy way yet to migrate my documents with versioning to Alfresco.

  • July 5, 2012 at 8:56 am

    On my server, Apache/2.2.9 PHP 5.3.3-7 Debian, I needed to fix the error_reporting in /etc/php5/apache2/php.ini too.
    By the way, it is not needed to set the error_reporting to 0, “E_ALL & ~E_WARNING & ~E_NOTICE & ~E_DEPRECATEDE_ALL & ~E_WARNING & ~E_NOTICE & ~E_DEPRECATED” (in both dmsDefaults.php __and__ php.ini) will do the trick.


Comments are closed.