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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:29:12+00:00 2026-05-18T21:29:12+00:00

What is your recommended best practice for a LAMP server with sort of a

  • 0

What is your recommended best practice for a LAMP server with sort of a high simultaneous load and I need to handle file I/O without getting too hung on a file lock?

I mean, let’s say I want to have a SUBSCRIBERS.CSV file that has a bunch of names and email addresses in it. But I want people to be able to fill out a form to unsubscribe. The unsubscribe action would scroll through that file to delete a matching line if it exists for a given email address. This seems like a simple task in PHP, but what happens when you have like 10 people trying to unsubscribe at once, and 10 new subscribers being added? That’s where I think PHP might run into trouble and an error might be generated due to a file lock, unless Linux or PHP is more capable than I think.

Note my client wants a CSV file, not a database table. In a database table, this would not be a problem, but as file I/O, I might run into a potential issue, right?

(BTW, to prevent identity theft, I use an .htaccess trick so that one can’t download the CSV over the web by guessing its name — it must only be accessed either by my PHP script or by FTP.)

  • 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-05-18T21:29:12+00:00Added an answer on May 18, 2026 at 9:29 pm

    If the requirement is for the client to interface with a CSV file, you don’t need to actually use the CSV file as the datastore. Instead, use a database, do all your work in a database, and let PHP generate the CSV file on demand.

    So, if a client needs to access http://example.com/SUBSCRIBERS.CSV, just have PHP handle SUBSCRIBERS.CSV and use something like:

    header("Content-type: text/csv");
    $data = get_subscriber_data();
    foreach ($data as $row) {
      // $row is an array of columns
      print implode(',', $row);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question is for ASP.NET and SQL Server developers. What are your best practices
Using SqlParameters is a recommended method to prevent SQL Injection in your database queries.
With your help I could take the input from a text file (input.txt) where
Please your opinion on the following code. I need to calculate the diff in
If your server has SSL enabled, and you're using YUI uploader, is it possible
Why its recommended not use onclicks in your HTML.Use Event Handlers in your JS
We're just getting started with a new project Visual Studio 2010 Team Foundation Server,
In my pre-ASP.NET development environment, there was a near-universal best practice: * NEVER use
Coming from Java, I'm wondering if a Java best practice applies to JavaScript. In
Please can anyone recommend a quick checklist / best practice guide to help us

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.