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

The Archive Base Latest Questions

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

So I found a function from http://php.net/manual/en/function.exec.php function execInBackground($cmd) { if (substr(php_uname(), 0, 7)

  • 0

So I found a function from http://php.net/manual/en/function.exec.php

function execInBackground($cmd) {
if (substr(php_uname(), 0, 7) == "Windows"){
    pclose(popen("start /B ". $cmd, "r")); 
}
else {
    exec($cmd . " > /dev/null &");  
}
}

Windows Usage:

pclose(popen('start /B php path/to/background_cron.php', 'r'));

Unix Usage:

exec('php path/to/background_cron.php >> path/to/background_error.log &')

But when these lines are called nothing actually happens (after waiting 5 or so minutes). Am I doing something wrong? prior to these lines being activated I have a file_exists checking if my path/to/background_cron.php exists and it if it doesn’t it will return a error.

On the live unix server all the folder permissions are set to write,read,execute for owner,group,public (0755) and file permissions are set to read for owner,group,public (644). The background_log comes up empty after the unix command runs, it creates 4 new blank lines (\n) but doesn’t return any expections

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

    One thing that’s a little odd in windows is that since the webserver is running as a different user, it launches apps in its own userspace – not your desktop.

    It’s possible the process is launching and isn’t in your process list – check it for all users. Also, check the event log in case it’s trying to run but throwing an exception

    Another possibility is that the web user doesn’t have permissions to execute the command- Have a look at who the app pool is running as and check their permissions to those folders.

    Be careful you don’t create security holes by allowing the webserver to run arbitrary code.

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

Sidebar

Related Questions

I found this example PHP source code at HTTP POST from PHP, without cURL
This is my code: function get_remote_file_to_cache(){ $sites_array = array(http://www.php.net, http://www.engadget.com, http://www.google.se, http://arstechnica.com, http://wired.com); $the_site=
I'm using the source code found on this site here: http://webtint.net/tutorials/5-star-rating-system-in-php-mysql-and-jquery/comment-page-1/#comment-2562 A fantastic resource,
I found this from C++FAQ Generally, No. From a member function or friend of
So: I have the following function, adapted from a formula found online, which takes
I'm using the following code to create an xls file from php. http://www.appservnetwork.com/modules.php?name=News&file=article&sid=8 However,
A PHP function I am writing pulls a small bit of HTML data from
I found this function that does an AWESOME job (IMHO): http://nadeausoftware.com/articles/2007/06/php_tip_how_get_web_page_using_curl /** * Get
I am trying to call the __doPostback javascript function in a asp.net page from
Code can be found here: http://www.myhorizon.ca/client_central/sortable_test.php Hello folks of Stackoverflow, I have a list

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.