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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:53:58+00:00 2026-06-17T22:53:58+00:00

I have this exec command which runs just fine, but doesn’t free up the

  • 0

I have this exec command which runs just fine, but doesn’t free up the browser (ie. there is a php timeout issue, but the actual command continues to run):

exec("/usr/local/php53/bin/php csv.php $file $user > /dev/null");

When I run ps auxw I see these two running processes:

sh -c /usr/local/php53/bin/php csv.php /tmp/php9Pwu9e 294  >
/usr/local/php53/bin/php csv.php /tmp/php9Pwu9e 294

However, when I run the code below, the browser immediately is free, but the command doesn’t continue to run:

exec("/usr/local/php53/bin/php csv.php $file $user > /dev/null &");

When I run ps auxw I see one running process that dies after 16 seconds (and seems to eat up memory quickly and use a lot of CPU%):

/usr/local/php53/bin/php csv.php /tmp/php9Pwu9e 294

Then the process dies without having actually done anything. Not sure what the ampersand is doing that would cause this.

Also why does sh -c appear when no ampersand is present at the end? I feel that this may be indicative of something, but have no idea what.

EDIT:

Because this keeps cropping up as an answer,
I have also tried:

exec("/usr/local/php53/bin/php csv.php $file $user > /dev/null 2>&1 &");

Which demonstrates the same issue as mentioned above.
The code below, does run, but does NOT free up the browser.

exec("usr/local/php53/bin/php csv.php $file $user > /dev/null 2>&1");
  • 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-17T22:53:59+00:00Added an answer on June 17, 2026 at 10:53 pm

    The issue was much simpler than I had thought. The problem was the $file (which was an uploaded file being stored in the /tmp directory) was not found. I’m not sure why, but I imagine it has something to do with the file being destroyed before the background process can get to it.

    The solution was to move_uploaded_file() the file to a permanent location, and run the script with that file. That worked.

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

Sidebar

Related Questions

I have a installation setup with works like this: /exec.exe /some-command This whole setup
I have a php file which runs a '.jar' file. Code is given bellow
I have a PHP script which contains a shell_execute() and the command it executes
This is driving me crazy. I need to have php execute a command to
I have a PHP script which calls exec() . I've been having trouble all
I have a php file 'run.php' which I'm running from the terminal. Within this
So this is the scenario. I have <target name=test> <property file=blah></property> <exec dir= executable=trast.exe
I have this form, in which i need to populate a combo box with
I have the following command which will take ages to run (couple of hours).
I have a .jar file which has a command line interface. I want to

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.