Skip to content

Not working after upgrading to PHP 7.3 #540

Closed

Description

@dportalesr

From @dciancu:

After upgrading PHP to 7.3.0 - latest version (and Xdebug to 2.7.0beta1 latest version compatible with PHP 7.3, in case it matters), tinker is no longer working. It launches correctly but I after I input a command it just exits with no error, nothing written to log file and status code 0.

laravel/tinker#63

I can confirm it's happening to me as well. Any input closes the REPL, no errors or messages at all.

Any ideas about how to proceed? Thanks.

Activity

  1. GrahamCampbell commented on Dec 8, 2018

    @GrahamCampbell
    Contributor

    Does it work after uninstalling xdebug?

  2. GrahamCampbell commented on Dec 8, 2018

    @GrahamCampbell
    Contributor

    xdebug 2.7.0beta1 is not actually compatible fully with php 7.3 yet. No release or even master of xdebug fully works yet.

  3. dciancu commented on Dec 8, 2018

    @dciancu

    @GrahamCampbell It doesn't work with xdebug disabled either

  4. dciancu commented on Dec 8, 2018

    @dciancu

    xdebug works very well with php 7.3 from what I have tested, had no issue with it.

  5. GrahamCampbell commented on Dec 8, 2018

    @GrahamCampbell
    Contributor

    Does it work after full uninstallation of the plugin, not just disabling?

  6. GrahamCampbell commented on Dec 8, 2018

    @GrahamCampbell
    Contributor

    xdebug works very well with php 7.3 from what I have tested, has no issue with it.

    There are various known issues documented on xdebug's github, including a failing test suite.

  7. dciancu commented on Dec 8, 2018

    @dciancu

    @GrahamCampbell not disabled by xdebug.enable, but removed from php.ini I meant

  8. dportalesr commented on Dec 9, 2018

    @dportalesr
    Author

    Apparently Xdebug added support for PHP 7.3 recently
    https://bugs.xdebug.org/view.php?id=1519
    xdebug/xdebug#430

    As @GrahamCampbell mentions there are still a couple of issues in their tracker. Not sure how to generate a report of this problem for them.

  9. chapeupreto commented on Dec 9, 2018

    @chapeupreto

    I have a fresh PHP7.3 install (brew install php@7.3) with no xdebug and that very same problem is happening to me as well:

    bug

  10. bobthecow commented on Dec 9, 2018

    @bobthecow
    Owner

    Update: as discussed below, this is a bug in Homebrew/macOS/PHP/pcntl. It should really be worked around by disabling pcre.jit in your php.ini.

    It has something to do with forking / pcntl. I'm trying to sort it out.

    In the meantime, you can use PsySH by disabling pcntl support, by adding this to your config file:

    // really, don't do this. disable it in php.ini :)
    return [
      'usePcntl' => false, 
    ];
  11. added a commit that references this issue on Dec 10, 2018
  12. bobthecow commented on Dec 10, 2018

    @bobthecow
    Owner

    Ok, got it!

    Homebrew-installed PHP 7.3.0 on Mojave segfaults when calling preg_match from a child process.

    Repro:

    <?php
    
    if (preg_match('/./', 'a')) echo "pre-fork works\n";
    
    $pid = pcntl_fork();
    if ($pid == -1) {
        die('fail');
    } elseif ($pid) {
        if (preg_match('/./', 'a')) echo "parent works\n";
        pcntl_wait($status);
        if (pcntl_wifsignaled($status) && pcntl_wtermsig($status) == SIGSEGV) {
            die('child process segfaulted');
        }
    } else {
        if (preg_match('/./', 'a')) echo "child works\n";
    }

    In PHP < 7.3, this results in:

    pre-fork works
    parent works
    child works
    

    But in PHP 7.3, we get:

    pre-fork works
    parent works
    child process segfaulted
    

    I'm not sure what the extent of this issue is. 3v4l.org doesn't have PCNTL so we can't test there. All versions of PHP that Travis tests worked. That said, Travis is testing RC3, so it might be a bug introduced between that and the stable release?

    Are y'all on Homebrew + Mojave? Can anyone repro this with other PHP 7.3 versions or sources or operating systems?

  13. dportalesr commented on Dec 10, 2018

    @dportalesr
    Author

    Are y'all on Homebrew + Mojave?

    Yeah.

  14. chapeupreto commented on Dec 10, 2018

    @chapeupreto

    Just to let you know: same problem with PHP7.3 running on macOS High Sierra

  15. 63 remaining items

  16. welenofsky commented on Jul 9, 2019

    @welenofsky

    I'm using latest macOS 10.14.5, with both pcre and pcre2 installed via Homebrew, with version 8.43, and 10.33, respectively. And php actually uses pcre according to this

    ~ »  brew uses pcre --installed
    cairo                 glib                  imagemagick           nginx                 shared-mime-info      zsh
    ffmpeg                harfbuzz              libass                php                   the_silver_searcher
    ~ »  brew uses pcre2 --installed
    fish                                                                ripgrep
    

    I am using the same macOS version (10.14.5) and same PCRE/PCRE2 versions as you listed. Wondering what the difference could be.

  17. bobthecow commented on Jul 10, 2019

    @bobthecow
    Owner

    I'm also forgetting and wonder if this is isolated to Mac's or if it would also affect other Unix based systems?

    It has been reported on Linux systems as well.

  18. zeshan77 commented on Oct 2, 2019

    @zeshan77

    Update: as discussed below, this is a bug in Homebrew/macOS/PHP/pcntl. It should really be worked around by disabling pcre.jit in your php.ini.

    It has something to do with forking / pcntl. I'm trying to sort it out. In the meantime, you can use PsySH by disabling pcntl support, by adding this to your config file:

    return [
      'usePcntl' => false,
    ];
    

    It worked for me. Thanks for the workaround!

  19. pinned this issue on Oct 23, 2019
  20. mk-conn commented on Oct 30, 2019

    @mk-conn

    Just upgraded to PHP 7.3.11 and psysh is working again

  21. ramsey commented on Oct 30, 2019

    @ramsey

    I can confirm the same. I do not need to set usePcntl to false when running psysh on PHP 7.3.11.

  22. driesvints commented on Oct 30, 2019

    @driesvints

    Same for me. Seems to be finally fixed 👍

  23. zymawy commented on Oct 30, 2019

    @zymawy

    Confirmed ! 🥇

  24. chapeupreto commented on Oct 30, 2019

    @chapeupreto

    All good here (PHP 7.3.11)

  25. welenofsky commented on Oct 31, 2019

    @welenofsky

    Confirmed here as well!

  26. bobthecow commented on Dec 1, 2019

    @bobthecow
    Owner

    Working for me as well.

    I'm going to close this, but leave it pinned, so people can find it if they need to.

  27. unpinned this issue on Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions