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

  • SEARCH
  • Home
  • 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 8486357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:55:27+00:00 2026-06-10T20:55:27+00:00

I set up a metadata cache in Zend Framework because a lot of DESCRIBE

  • 0

I set up a metadata cache in Zend Framework because a lot of DESCRIBE queries were executed and it affected the performances.

$frontendOptions = array ('automatic_serialization' => true);
$backendOptions = array ('cache_dir' => CACHE_PATH . '/db-tables-metadata');
$cache = Zend_Cache::factory(
    'Core',
    'File',
    $frontendOptions,
    $backendOptions
);
Zend_Db_Table::setDefaultMetadataCache($cache);

I can indeed see the cache files created, and the website works great.

However, when I launch unit tests, or a script of the same application that perform DB queries, I end up with an error because Zend couldn’t read the cache files.

This is because in the website, the cache files are created by the www user, and when I run phpunit or a script, it tries to read them with my user and it fails.

Do you see any solution to that? I have some quickfix ideas but I’m looking for a good/stable solution. And I’d rather avoid running phpunit or the scripts as www if possible (for practical reasons).

  • 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-10T20:55:29+00:00Added an answer on June 10, 2026 at 8:55 pm

    try sudo command. something like this $sudo -u www php -f run-tests.php

    edit

    maybe

    $backendOptions = array ('cache_dir' => CACHE_PATH . '/db-tables-metadata', 'cache_file_umask' => 0755, 'cache_file_perm' => 0755);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use xcache with zend framework to cache the metadata from
I'm updating existing objects in an Amazon S3 bucket to set some metadata. I'd
I'm creating a capture form on the fly based on a set of metadata
Seems like the slow Tomcat 7 startup problem can be resolved with metadata-complete set
I need set a cultureinfo different of others in a currency field. Metadata: [Display(ResourceType
Why can't I set ShowForEdit model metadata with an attribute? It seems that the
I need to set the metadata for binary files which are generated by XCode.
When registering a dependency property how do I set metadata options without setting a
I've set up mvc-mini-profiler against my Entity Framework-powered MVC 3 site. Everything is duly
Why doesn't my WCF service provide metadata locally, when I think I have set

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.