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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:44:33+00:00 2026-06-17T12:44:33+00:00

machine 1 – client using PHP api $client = new \GearmanClient(); $client->addServer(..); $client->doBackground(‘demotask’, ‘hello

  • 0

machine 1 – client using PHP api

$client = new \GearmanClient();
$client->addServer(..);
$client->doBackground('demotask', 'hello world');

machine 2 – workers – not using PHP api, directly in bash:
gearman -w -f demotask -- php -f taskexecutor.php

The taskexecutor is getting run, but $argv does not contain hello world as expected.

P.S. not interested in PHP’s API and a forever while loop on the second machine. I want gearman to start my script when it needs

  • 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-17T12:44:35+00:00Added an answer on June 17, 2026 at 12:44 pm

    I really wouldn’t recommend this implementation. If anything goes wrong in your php script, you won’t be able to resubmit the job, or communicate with gearman.

    Anwyays, the issue is that when the gearman client grabs the job, the job workload is passed to STDIN of your php process. So that means that $argv is always going to be empty. The parameters that you pass in can be read from STDIN like so;

    $params = fgets(STDIN);

    I’d recommend passing your params as JSON string so you can use simple functions like json_encode and json_decode, and not have to worry too much about structure or encoding, etc.

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

Sidebar

Related Questions

I have a machine with Ubuntu 12.04 and have installed Jenkins ver. 1.424.6 using
I have a weighing machine that is connected to a computer using a serial
I'm using Cache Machine to cache QuerySets which involves adding this to your model:
On a Windows machine, the following script: <?php mkdir(c:\\[test]); file_put_contents(c:\\[test]\\test.txt, some content); chdir(c:\\[test]); echo
Is machine byte order affect to unpack function in php?
I have updated my machine from PHP 5.3 to PHP 5.4 and my CakePHP
I want to get machine id of client computer. Client will log in to
my machine died. I need to download the source to a new machine. I
On my local machine, I visit the url http://api.deezer.com/2.0/search/artist?q=feeder and get the correct json
How to retrieve client machine's name, and current time and date to save a

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.