Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8482289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:47:11+00:00 2026-06-10T19:47:11+00:00

Recently moved server and trying to get everything set up. My memcache class writes

  • 0

Recently moved server and trying to get everything set up. My memcache class writes logs, something I need for development.

edit: server running Ubuntu 12.04.

the webroot is
/var/www/public_html

the log file is in /var/www/logs/

Here are the directory permissions

-rw-r--r-- 1 root root       1415 Sep  6 11:53 default
drwxrwxr-x 2 root webmasters 4096 Sep  6 12:48 logs
drwxrwxr-x 8 root webmasters 4096 Sep  6 12:32 public_html

Here are the permissions from /var/www/logs

-rw-rw-r-- 1 root webmasters 116103 Sep  6 13:02 access.log
-rw-rw-r-- 1 root webmasters  16094 Sep  6 12:48 error.log
-rw-rw-r-- 1 root webmasters      0 Sep  6 12:48 memcache.log
-rw-rw-r-- 1 root webmasters   9861 Sep  6 13:02 php_log.log

The file being browser to is /var/www/public_html/index.php

-rw-rw-r-- 1 root webmasters 5660 Sep  6 01:51 /var/www/public_html/index.php

Index includes /var/www/public_html/includes/cache.php

-rw-rw-r-- 1 root webmasters 4602 Sep  6 12:47 /var/www/public_html/includes/cache.php

Group members:

grep 'webmasters' /etc/group
webmasters:x:1002:sftp_chris,www-data

I have even tried changing /logs and /memcache.log to chmod 777.

Not really understanding why this is happening, as you can see php is writing its log file to /logs/php.log without issue.

Any ideas? I’m absolutely baffled.

I thought maybe it had something to do with php-suhosin but couldn’t find anything there.

the function:

function write_to_log($string){

    $file = '/var/www/memcache.log';
    $fh = fopen($file, 'a');
    $contents = @fread($fh, filesize($file));
    $stringData = $contents."[".date('H.i:s d-m-y')."] ".$string;
    fwrite($fh, $stringData);
    fclose($fh);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T19:47:13+00:00Added an answer on June 10, 2026 at 7:47 pm

    You write to /var/www/memcache.log, not /var/www/logs/memcache.log for which you show permissions.

    (why do you read the log before writing to it?)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently had to drop the Django development server and moved to apache because
I have recently moved our TFS 2010 server to new server, when I'm trying
I have recently moved our TFS 2010 server to new server, when I'm trying
I have recently moved our TFS 2010 server to new server, I'm trying to
I recently moved my whole local web development area over to using MacPorts stuff,
I recently moved a database from a 'SQL Server 2005 SP1' instance to 'SQL
We recently moved our database from our SQL Server 2005 server to our SQL
I recently moved my Drupal 7 site to a new hosting server and I'm
We have recently moved to a new web server (from IIS6 to IIS7.5) and
I have recently moved a magento installation of version 1.5.0.1 to a live server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.