Since the program can be run from the command-line and no response is needed, using exec() does the job.
http://php.net/manual/en/function.exec.php
The first example in the comments (below) was used to run my command-line program on payment submission. The program launches and the user never awaits its completion. Shouldn’t matter if your machine is Windows or otherwise.
function execInBackground($cmd) {
if (substr(php_uname(), 0, 7) == "Windows"){
pclose(popen("start /B ". $cmd, "r"));
}
else {
exec($cmd . " > /dev/null &");
}
}
In my scenario, $cmd is ‘php54 [directory/file.php] [program parameters]’.
Related Posts:
- wp-cli displays php notices when display errors off
- How to use command ‘wp post create’ in wp-cli properly?
- Find WordPress root directory in bash without WP-CLI
- “No such file or directory” but it exists
- Error unable to access jarfile C:\Jar
- Node.js version on the command line? (not the REPL)
- How to pretty print XML from the command line?
- Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)
- How to find which version of TensorFlow is installed in my system?
- How do I copy a folder from remote to local using scp?
- What does cmd /C mean?
- How do I parse command line arguments in Bash?
- What does cmd /C mean?
- https connection using CURL from command line
- syntax error when using command line in python
- How to install JQ on Mac on the command line?
- Using multiple delimiters in awk
- Create an empty file on the commandline in windows (like the linux touch command)
- Why do JVM arguments start with “-D”?
- How do I import an SQL file using the command line in MySQL?
- How to reload .bash_profile from the command line?
- What is the purpose of “&&” in a shell command?
- Angular – ng: command not found
- How to run SQL script in MySQL?
- Mysql: Setup the format of DATETIME to ‘DD-MM-YYYY HH:MM:SS’ when creating a table
- How can I pass an argument to a PowerShell script?
- Command Prompt “Net View System Error 6118”
- Windows 7 Symbolic Link – Cannot create a file when that file already exists
- mkdir’s “-p” option
- How do I make a python script executable?
- What is cp: cannot stat error in Unix, I get this error when trying to copy thing from one folder to another
- Run C++ in command prompt – Windows
- What is cp: cannot stat error in Unix, I get this error when trying to copy thing from one folder to another
- fatal: This operation must be run in a work tree
- Run R script from command line
- How to edit a py file from terminal?
- How do you input command line arguments in IntelliJ IDEA?
- How do I parse command line arguments in Java?
- How to colorize diff on the command line
- Python not working in the command line of git bash
- How to count lines in a document?
- What is the reason for the CD /D switch in Windows cmd?
- Running Command Line in Java
- How to easily print ascii-art text?
- phpmyadmin #1045 Cannot log in to the MySQL server. after installing mysql command line client
- git undo all uncommitted or unsaved changes
- Run Command Prompt Commands
- What is %0|%0 and how does it work?
- npm install multiple package names
- How to recursively download a folder via FTP on Linux
- Install oAuth PECL error: Cannot install, php_dir for channel “pecl.php.net” is not writeable by the current user
- Command prompt won’t change directory to another drive
- How to stop (and restart) the Rails Server?
- How to compile C program on command line using MinGW?
- how to empty recyclebin through command prompt?
- Timeout a command in bash without unnecessary delay
- Initialize WordPress environment to use in command line script
- Access WordPress API Outside of WordPress (command-line PHP)
- Determining WordPress’ Version from the Host’s Command Line?
- Running WordPress on the Command Line – Turn off Delayed Output?
- Alternative to get_posts() due to multithreading cache crash
- How To Export/Import WordPress (MySQL) Database Properly Via Command-Line?
- Where/how are categories stored?
- WordPress and multithreading
- How do I delete all generated images from my server except those currently used in posts
- Generate WP-CLI @alias for each site on multisite
- How do I set and list page_template with wpcli?
- Initialize WordPress environment to use in a real cron script
- Run W3 Total Cache Flush Function with Crontab [closed]
- Get threaded comments number
- Last comment page first with full number of comments?
- Toggle nested comments
- How to change a post attribute to homepage using WP CLI?
- Threaded commenting: how to show threads by last active first?
- Shortest way to install WP-CLI
- WP Cli will not execute on Windows
- wp-env mysqlcheck error:1130
- How can I use PurifyCSS to clean WordPress style.css?
- How to run a php file that uses wordpress functions from command line?
- How to retrieve text only from a post using WP CLI?
- wp search-replace (not executing)
- How wp-cron can run in background if PHP is single threaded?
- Other than WP-CLI, is there a way to install WordPress via the command-line?
- Running custom defined WP-CLI commands without WordPress installation present
- Filtering Comment Reply Links (comment_reply_link_args) for “infinite replies” in nested comments
- Change WordPress URL in sql file via Terminal
- How can I list all installed plugins/themes/versions from CLI/API?
- Get plugin download URL from slug
- Carriage Return control character (^M) found in wp-config-sample.php
- wp-cli for Creating page-template
- Database Update Required – Update from command-line
- How to remove all plugins, posts, pages, and inactive themes in one line with wp-cli? WordPress bloatware removal
- bash script wp-cli search-replace 0 replacements, but command-line 3000+
- How to enable reply button on mostly deeply-nested comments? [closed]
- Removing a line from a WP core function (comment_template.php) – filter or other technique?
- How to force users to nest their comments
- different levels of nested comments per page
- Why can’t the WP-CLI installer find my php.ini?
- Bulk delete media by year
- Does WordPress handle concurrency and atomicity properly?