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 8794361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:14:27+00:00 2026-06-13T23:14:27+00:00

CODE: if (flock($fp, LOCK_EX)) { fwrite($fp, serialize($this->_contents)); flock($fp, LOCK_UN); } ERROR: Fatal error: Allowed

  • 0

CODE:

if (flock($fp, LOCK_EX))
{
    fwrite($fp, serialize($this->_contents));
    flock($fp, LOCK_UN);
}

ERROR:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 17805286 bytes).....

ERROR LINE:

fwrite($fp, serialize($this->_contents));

Any idea how to solve the issue? My site hosted on shared hosting so I have no chance changing memory settings.

Thanks

  • 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-13T23:14:28+00:00Added an answer on June 13, 2026 at 11:14 pm

    Most likely serialize($this->_contents) is the problem.
    I generally tend to suggest to NOT use serialization to store things in a db or files.

    You should split the data inside _contents and write them separately.

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

Sidebar

Related Questions

This is the code: void i_log_ (int error, const char * file, int line,
I am using the following code: $fp = fopen(lock.txt, w); if (flock($fp, LOCK_EX|LOCK_NB)) {
i have this following php code : $filename = '/front/style.css'; $cssfile='#h1{font-size:12px}'; if($id_file=fopen($filename, w+)) {
Code: String message = MessageFormat.format(error {0},e); E.g. message: java.text.ParseException: Unparseable date: sdf sf sa
Code sample for my question: IList<TestDataAnimal> testDataFromDb = this.db.TestDataAnimals.Include(t => t.TestType).Include(t => t.Visit).Include(t =>
Let's say I have this code snippet running. class Song def initialize(name, artist, duration)
I see people using flock like this: if (!$fp = fopen($file_name, 'wb')) { return
Valgrind throws me out this error: ==11204== Syscall param write(buf) points to uninitialised byte(s)
At the moment this is what my code looks like: if (!flipped){ scaleX -=
The following code snippet causes error....the logcat has been attached...I am tring to pass

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.