Giter VIP home page Giter VIP logo

background-process's People

Contributors

bitdeli-chef avatar bpolaszek avatar mhor avatar samyoul avatar socieboy avatar sponno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

background-process's Issues

"Fatal Error Unable to reattach to base address" while running in cmd and PowerShell

When running background commands (here is my code) in Windows PowerShell or cmd shell, the command fails and the error Fatal Error Unable to reattach to base address is printed to STDOUT. This doesn't happen when running the same code under Git Bash, where the commands execute as intended. A typical command that I am running is "php m:\mik_mark\extras\scripts\postwritehooks\validate_mods.php", with some arguments to the validate_mods.php script added at runtime.

A quick google for that error brings back some issues surrounding Zend Opcache (like this one).

Has anyone seen this before or have any suggestions as to how work around it? I'm on Windows 7 Enterprise SP1 (64 bit). php -v produces:

PHP 5.6.2 (cli) (built: Oct 15 2014 14:55:48)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies

Stop Process By ID

How to stop process by ID?
I am using stable version.
Thanks.

$process = new BackgroundProcess('/usr/bin/php queue.php');
        if ($process->isRunning(15371)) {
            $process->stop();
        }

isRunning is not working in docker container

Hello im using php-fpm alpine docker

the isRunning function always says true because the output of this code :
$result = shell_exec(sprintf('ps %d 2>&1', $this->pid));

is something like this :
PID USER TIME COMMAND\n 1 root 0:00 {supervisord} /usr/bin/python2 /usr/bin/supervisord -n -c /etc/supervisord.conf\n 15 root 0:00 crond -f /dev/null\n 17 root 0:00 php-fpm: master process (/usr/local/etc/php-fpm.d/www.conf)\n 18 root 0:00 nginx: master process /usr/sbin/nginx -g daemon off; error_log /dev/stderr info;\n 19 nginx 0:00 nginx: worker process\n 20 nginx 0:00 nginx: worker process\n 21 nginx 0:00 php-fpm: pool www\n 22 nginx 0:00 php-fpm: pool www\n 23 nginx 0:00 php-fpm: pool www\n 114 root 0:00 /bin/bash\n 270 root 0:00 php artisan streams:uptime\n 275 root 0:00 ps 90\n

so the count check after (the if statement) always get TRUE because it returns mother than 2 rows

Stable Tag

Hi,

I would know if possible to create one stable TAG.

I saw your last TAG is pre-release.

Is possible?

Thank you.

Run succeed but not found in background process list

I have a code which is collecting data.
When I run your code, I got the PID but I dont get the data.
So, I check the background process with terminal and I found nothing with the same PID.
When I run manually with "php collect.php" command, my code run normally and I get the data.
Is there anything I miss?
Thanks.

This is my code.

$process = new BackgroundProcess("php /var/www/html/project_name/public/assets/collect.php");
$process->run();

echo sprintf('Crunching numbers in process %d', $process->getPid());
while ($process->isRunning()) {
        echo '.';
        sleep(1);
}
echo "\nDone.\n";

How do I send the parameter?

Hi,

$firstWords = "Hello World";
$process = new BackgroundProcess('/usr/local/bin/php /home/[...]/test.php');

test.php:

echo "This is first words: ".$firstWords; // print: "This is first words: ";

The strings do not reach the other page. I wanted to use argv in Cron for this. (link) it still did not work.

what is your idea on this issue?
Thanks

Notice: Array to string conversion

hi,
i try to use $phar->buildFromDirectory($path.'/'.$url) in the backgroundProcess, but got an error

Notice: Array to string conversion


ContextErrorException
--
Symfony\Component\Debug\Exception\ContextErrorException: Notice: Array to string conversion    at vendor/cocur/background-process/src/BackgroundProcess.php:74   at Cocur\BackgroundProcess\BackgroundProcess->run()      (src/AppBundle/Controller/DefaultController.php:86)   at AppBundle\Controller\DefaultController->AjaxAction(object(Request))   at call_user_func_array(array(object(DefaultController), 'AjaxAction'), array(object(Request)))      (var/cache/dev/classes.php:4507)   at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)      (var/cache/dev/classes.php:4462)   at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)      (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:169)   at Symfony\Component\HttpKernel\Kernel->handle(object(Request))      (web/app_dev.php:14)

the result of the $phar->buildFromDirectory is an array by default

The PHP >= 5.6 requirement has broken deployments.

Is there a feature in php 5.6 that is required to make this run? Can you update this to php >= 5.4 in composer.json unless you really need a feature only available in 5.6 ?

As a work around, will use version 0.5.

Integrate to Codeigniter

Hi,

Thank you for this script.
I try to integrate it into codeiginiter but I don't know how.
Can some one helpme to do this.
Thank you.

Run in wamp

How can I make this work on windows wamp? Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.