Closed (won't fix)
Project:
Drush
Version:
8.x-6.x-dev
Component:
User Commands
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
24 Dec 2011 at 17:34 UTC
Updated:
11 Sep 2013 at 05:08 UTC
Hi all,
I am trying to install drush but keep getting this error message. The symlink works, but when I then execute "drush status" I get this message:
"PHP Fatal error: Call to undefined function posix_getppid() in /home/drush/includes/sitealias.inc on line 1907
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Call to undefined function posix_getppid() in
/home/drush/includes/sitealias.inc, line 1907"
I can't find any information about this function any or similar bug report. Please help!
Thanks
Comments
Comment #1
moshe weitzman commentedThis comes form the new site-set code.
Comment #2
greg.1.anderson commentedAccording to this posix_getppid manpage, this function is available for PHP3 >= 3.0.10, PHP4 >= 4.0b4. I can't imagine why this function would be unavailable. Maybe this is a Windows issue?
@Maxim75, what version of PHP are you using? What platform are you running on?
Comment #3
greg.1.anderson commentedAh, here we go:
http://www.php.net/manual/en/pcntl.installation.phphttp://us3.php.net/manual/en/intro.posix.php
Doesn't work on Windows,
not alwaysavailable on Linux unless disabled. I imagine we need a function_exists, with some sort of fallback behavior when it is not available. One temp file == one site to use for all terminals, maybe (when posix_getppid not available)? Not ideal; maybe some Windows folks might know how to get a unique reference per-shell from Powershell / DOS / msysgit.Edit: Accidentally quoted the wrong manual page; corrected.
Comment #4
tezalsec commentedHi all,
well, that makes sense I couldn't figure it out.. I'm on Linux (OpenSuse), not on Windows. So I guess the function isn't available then. Further, I am working with PHP 5.2.x and Drupal 6.22.
But for now, to get drush going (on Drupal 6), since there are no stable releases other than the 7 (which I am assuming is only for Drupal 7?), do you recommend using the 4.x-dev version, or does that have the same issue/function?
Regards,
Maxim75
Comment #5
moshe weitzman commentedStumbled on http://drupal.org/project/features_scripts, which suggests that at least MsysGit shell on Windows has Posix. So lets not remove feature for all Windows shells.
Comment #6
moshe weitzman commentedWait - pcntl is not same as posix. We aren't using pcntl here.
My Windows does not have this posix_getppid() either (Windows 7). It is possible that Windows server OS support this function.
Someone might be able to use info on these links to get it working on other shells: http://www.codeproject.com/KB/threads/ParentPID.aspx and http://commandwindows.com/tasklist.htm.
FYI, I committed a fix for site-reset so that it works when we have set to a remote site.
Comment #7
moshe weitzman commentedJust to get Windows working again, I added a function-exists() before calling this function and committed to master. See 7162b1a.
Leaving this open in case we want to do more.
Comment #8
beltofteNeither PHP 5.3.8 or 5.2.17 running on my VM with Windows Server 2008 R2 has this function.
Comment #9
greg.1.anderson commentedRe #6, yes, I accidentally wandered into the wrong section of the manual in #3; corrected above.
Comment #10
beltoftePowerShell has a variable called $pid which holds the process id. More details can be fetched using "get-process -id $pid". This does not work in CMD, and does not seems to work when executed using exec(), shell_exec(), system() etc.
Tasklist.exe both works on CMD and PowerShell, but it returns details on all processes or specific processes. If you have multiple PowerShell or CMD processes running is there not way to find the correct one......
http://www.codeproject.com/KB/threads/ParentPID.aspx. We could make an .exe file to return the parent process id using some of the Windows API's. It could be distributed in the Windows Installer or together with Drush it self. I could get one of our .NET developers to make this, if this is the solution we are going with.
Comment #11
greg.1.anderson commentedRegarding the .exe proposed at the end of #10: if we built this and ran it from Drush via exec/etc., would it return the pid of Drush, or the pid of the shell that ran Drush?
If the
laterformer, maybe we could call it from drush.bat, and pass the result in as a parameter to Drush.Comment #12
beltofteHmm.... good question. I will ask one of our .NET developers about this.
Comment #13
greg.1.anderson commentedThis issue was marked
closed (won't fix)because Drush has moved to Github.If desired, you may copy this bug to our Github project and then post a link here to the new issue. Please also change the status of this issue to
closed (duplicate).Please ask support questions on Drupal Answers.