Comments (23)
Or you on the latest dev version? Can you debug if the command is given correctly? No error logs?
from laravel-async-queue.
What version are you using?
from laravel-async-queue.
Tried 0.2.1 and latest dev, both are the same.
No error logs, just inserted. How can i debug if command is give correctly?
from laravel-async-queue.
https://github.com/barryvdh/laravel-async-queue/blob/master/src/AsyncQueue.php#L68
Output the result from getCommand() (or log it or something)
public function startProcess($jobId)
{
chdir($this->container['path.base']);
die($this->getCommand($jobId));
}
from laravel-async-queue.
'/usr/bin/php' artisan queue:async 6 --env=production > /dev/null 2>&1 &
This isn't the php path. ( On OSX )
from laravel-async-queue.
Okay what is the correct path? What PHP version are you on?
Does the PHP_BINARY
give you the correct value? You are on the latest dev-master, right?
Using:
protected function getPhpBinary()
{
$path = escapeshellarg($this->phpfinder->find(false));
$args = implode(' ', $this->phpfinder->findArguments());
return trim($path.' '.$args);
}
Can you try a different way, by requiring sebastian/environment
(https://github.com/sebastianbergmann/environment) and doing this:
use SebastianBergmann\Environment\Runtime;
$runtime = new Runtime;
var_dump($runtime->getBinary());
If that gets more reliable results, I can use that to detect the path.
from laravel-async-queue.
sebastian/environment
didn't work at all for me, which is why I removed it again. On windows, it was returning the path to the apache executable!
from laravel-async-queue.
Pff, why is it so hard to just find the php binary path. Maybe just make a config about it and put php
as the default.
from laravel-async-queue.
That's not a bad idea tbh. I do that in one of my packages to find "git". Maybe we should have an option to enable autofinding too?
from laravel-async-queue.
sebastian/environment returned an empty string, PHP_BINARY seems defined but empty, not sure what's the reason.
from laravel-async-queue.
Same issue here. I don't have time to debug this one so I'm moving on, but I hope this gets resolved.
from laravel-async-queue.
Why this jobs aren't automatically started? I need add to queue job, next method continue and job working in background
from laravel-async-queue.
Are you two having the same issue, about the path not being found? See the above commit, does that fix it for you? It defaults to 'php', but if you add a 'binary' option to the queue config, it should change.
'async' => array(
'driver' => 'async',
'binary' => '/path/to/php',
),
from laravel-async-queue.
Thank you for replay, in now works very well
from laravel-async-queue.
I've tweakd it a bit more. Should work the same as before, but auto-detection is removed (as it didn't really work), binary is escaped and arguments can be added also if you need.
Should not change anything for most ;)
Can the others confirm this fixes it?
from laravel-async-queue.
I have to resing for this soolution, beacouse I have only hosting and i can't use php commend in script. I'am waiting for new server. Thank you
from laravel-async-queue.
Mark as solved - i guess
from laravel-async-queue.
You guess? Or did you test it? :P
from laravel-async-queue.
Tested, path&command is correct but it's not getting executed.
Command works when executed through terminal but not being executed. Still testing what's wrong.
Edit: non-issue, works perfectly
from laravel-async-queue.
Hi!
I think I found the solution for windows users.
There was two problems around exec()
:
- Wrong start parametering. The first param with double quotes is the title of the window and after that comes the program and so on. Because you use
escapeshellarg()
the command was the following:
start /B "php" artisan queue:async 72 --env=local > NUL
, so php is the name of the new window and artisan was the program to start. Put two double quotes after the /B param ingetBackgroundCommand()
and the command will be:
start /B "" "php" artisan queue:async 72 --env=local > NUL
- I don't know why but the
exec()
method always run synchronously. For this I found the solution here: http://php.net/manual/en/function.exec.php#86329
After these fixies it works like a charm for me.
Thanks for this plug-in :)
from laravel-async-queue.
@slipy90 On what branch are you? The master branch doesn't escape the php command on windows and uses the Symfony Process instead of exec.
from laravel-async-queue.
I've tagged v0.3.1
, can you try with that?
from laravel-async-queue.
I used v0.3.0
and updated to v0.3.1
and works like a charm! Thanks for it!
from laravel-async-queue.
Related Issues (20)
- Issues with Process class and fromShellCommandline method in Laravel 8
- Notify when Queue ends
- Doesn't work with Laravel 5.6? HOT 2
- Laravel Horizon support? HOT 1
- Please support laravel 5.6.* HOT 2
- symfony/process 4+ error HOT 1
- Documentation HOT 1
- Laravel 5.7 support?
- Jobs freeze
- Prevent to exec a job before finish other
- cron jobed async queue is not working
- Errro Unknown error while connecting
- Laravel 5.8 issue
- Start Process is not compatible with symfony/process 5x
- How can I retry failed jobs?
- Laravel 7 / Synpony 5
- Alternative to the later method
- Suggestion to resolve queue conflict
- Dead lock HOT 1
- Doesn't make a lot of sense HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-async-queue.