PHP safe mode -> install problems?

Help
2009-01-12
2012-10-11
  • Alexander Hanysz

    Hi,

    I've installed PHPwiki 1.2.11 (with flatfile database), but I'm not seeing any pages. Instead I get error messages as below. My hosting provider tells me that turning off PHP safe mode is not an option. Should PHPwiki work OK with safe mode on? Any suggestions?

    Thanks.


    Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit in safe mode in /home/ha/han/hanysz.net/public/www/mathwiki/lib/setupwiki.php on line 31
    Inserting page AddingPages, version 1 from text file

    Warning: fopen() [function.fopen]: SAFE MODE Restriction in effect. The script whose uid/gid is 69089/100 is not allowed to access /home/ha/han/hanysz.net/public/www/mathwiki/pages owned by uid/gid 80/80 in /home/ha/han/hanysz.net/public/www/mathwiki/lib/db_filesystem.php on line 106

    Warning: fopen(/home/ha/han/hanysz.net/www/mathwiki/pages/pages/AddingPages) [function.fopen]: failed to open stream: Illegal seek in /home/ha/han/hanysz.net/public/www/mathwiki/lib/db_filesystem.php on line 106

    WikiFatalError
    Error while writing page 'AddingPages'

     
    • Alexander Hanysz

      Thanks. The advice I received from the system admin was: "Whenever you have a PHP script on our systems that needs to write to a resource ensure that said resource has its permissions set to 2777 (even if the documentation is set to 777)." Together with removing all the setTimeLimit calls, this seems to have fixed the problem.

       
    • Bernard Bel

      Bernard Bel - 2009-01-15

      I am a newcomer to PHP, so my reply might not be totally adequate.

      From the messages I understand that the PHP code used for creating the pages, the first time you run PhpWiki, contains a setTimeLimit() call. This function does not work in SAFE mode. It is required because the process of creating pages may take quite a while, and if it fails because of a time limitation you might be in trouble.

      I would request my system admin to remove SAFE mode just for the time of creating the new pages and checking that PhpWiki works. Then set it on again and see whether you still get this type of error message.

      Bernard Bel

       

Log in to post a comment.