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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:13:59+00:00 2026-05-23T12:13:59+00:00

In fixing a website for someone, I’ve run into the following problem: In order

  • 0

In fixing a website for someone, I’ve run into the following problem:

In order to process some data, it calls exec("/usr/bin/php /path/to/file.php input.dat"), while the file.php that gets called contains an include("config.php"), which, in turn, contains a call to session_start().

The problem that occurs is a deadlock waiting for flock("/tmp/sess_XXXXXX"). The parent script locks the session file, then the exec‘ed script attempts to continue the same session, locking that file again, but getting deadlocked waiting for it.

I’ve tried putting the following at the very beginning of the the exec‘ed script, but to no avail:

session_save_path("/tmp/alt_session");
session_id("NOTHING");

Obivously there’s something distinctly absurd about calling exec("php ...") from within a php script, but that’s an argument for another day, and not something I can change here. Also, while I’m free to change the file that gets run under exec, changing config.php would create a some other headaches that I’d prefer to avoid.

Any other options, or am I missing something important?

  • 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-23T12:14:00+00:00Added an answer on May 23, 2026 at 12:14 pm

    There is a php bug that I believe relates to your problem.

    In short, the solution was to run session_write_close() before file_get_contents(), (which in your case would be exec())

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

Sidebar

Related Questions

I am fixing some problems with a legacy system and have run into a
I'm fixing bugs for some application, and I need help understanding the following lines
I am working on fixing a website which is coded by someone else. Codes
I was fixing url's on a website, and one of the problems there was
Upon fixing my earlier problem where, I uninstalled both, JRE AND Java EE, and
Please help me with fixing the following error: This Android SDK requires Android Developer
Came into the office today to do some more work on my nearly completed
I have a problem with fixing the footer to the bottom of the browser
I have created a public repository on bit bucket website. I can run the
I am having my first foray into website design and I am learning a

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.