Jump to content


This topic is now archived and is closed to further replies.


[SOLVED] webcalendar 1.2 problem

Recommended Posts

I get a warning when I try and set the admin settings for the Webcalendar 1.2 the warning says:

Warning: unlink(/tmp/cf556e7d9a5d3658018d3287e86fccbezB1dat) [function.unlink]: Operation not permitted in /home/crowleys/public_html/calendar/includes/dbi4php.php on line 828

This is the snippet from the script:

function dbi_clear_cache () {
  global $db_connection_info;

  if ( empty ( $db_connection_info['cachedir'] ) )
    return 0;

  $cnt = 0;
  $fd = @opendir ( $db_connection_info['cachedir'] );
  if ( empty ( $fd ) )
    dbi_fatal_error ( translate ( 'Error opening cache dir' ) . ': '
       . $db_connection_info['cachedir'] );

  $b = 0;
  while ( false !== ( $file = readdir ( $fd ) ) ) {
    if ( preg_match ( '/^\S\S\S\S\S\S\S\S\S\S+.dat$/', $file ) ) {
      // echo 'Deleting ' . $file . '<br />';
      $fullpath = $db_connection_info['cachedir'] . '/' . $file;
      $b += filesize ( $fullpath );
      if ( ! unlink ( $fullpath ) )
        echo '<!-- ' . translate ( 'Error' ) . ': '
         . str_replace ( 'XXX', translate ( 'delete' ),
          translate ( 'Could not XXX file' ) ) . " $file. -->\n";
      // TODO: log this somewhere???
  return $cnt;

It seems to be an infinite loop, I have to stop the browser from running it.

Can anyone help? Is there another function used instead of unlink().

Share this post

Link to post
Share on other sites

I just thought about this, Why did this script work when my server was using php 4 but not when the server went to php 5. Has unlink been deprecated?

Share this post

Link to post
Share on other sites

The reason for the error is because it's trying to delete the temp files in the /tmp dir of the server.

Which you do not have access to delete those files.


I found my solution to be a bit more correct, as the application was designed to have a temp file system. Yes you can comment out the line db_cachedir:

But you can also change it to another path. 


Example: db_cachedir: /home/user/tmp_cal

Then CHMOD permissions to 0777


This will let the application do what is was designed to do. 


Also remember for security reasons do not make db_cachedir: in or after www or public_html


Hope this helps others..



Share this post

Link to post
Share on other sites

Thanks, yea that is what I finally did. I will have to look into where I have my temp folder.  Does anyone know how I can check to see if my send_reminder.php is not sending me my email? I really do not know what it does yet. Can anyone answer these question?

Share this post

Link to post
Share on other sites

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.