Full REPL not supported

前端 未结 4 1344
你的背包
你的背包 2021-01-12 13:50

I get an error when trying to use artisan command tinker. For example I would like to add a user. In my terminal I type

$ php artisan tinker 
相关标签:
4条回答
  • 2021-01-12 14:18

    Sometimes pcntl functions are disabled in some distros, so you have to

    Find your cli's php.ini file

    php --ini
    

    Edit it that php.ini, usually you'll have to do

    sudo gedit /etc/php5/cli/php.ini
    

    or

    sudo vim /etc/php5/cli/php.ini
    

    and comment a line that starts with

    ; disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,...
    

    You don't really have to comment it all, you can just enable pcntl functions, by removing them from that line, but if this is a development box, you can just enable everything.

    0 讨论(0)
  • 2021-01-12 14:21

    One or more of readline posix and pcntl extensions are missing. You need to compile PHP with the appropiate configuration options to enabled it.

    Here are the instructions:

    • readline http://www.php.net/manual/en/readline.installation.php
    • pcntl http://www.php.net/manual/en/pcntl.installation.php
    • posix http://www.php.net/manual/en/posix.installation.php

    Note that posix functions are enabled by default.

    0 讨论(0)
  • 2021-01-12 14:23

    I personally use MAMP and also rely on MAMP's version of PHP for the CLI. When I hit this issue I found that the Redline and PCNTL extensions were not part of MAMP's PHP distribution.

    I wrote an article on how I fixed the problem as well as a link to download the two extensions that I had to compile from source.

    http://adampatterson.ca/blog/2014/10/laravel-tinker-boris-mamp-os-x-yosemite/

    0 讨论(0)
  • 2021-01-12 14:29

    If you are on debian like me this should work:

    source: http://pkgs.org/debian-wheezy/dotdeb-i386/php5-readline_5.4.28-1~dotdeb.1_i386.deb.html

    Add the following line to /etc/apt/sources.list:

    deb http://packages.dotdeb.org/ wheezy all
    

    Install GPG key of the repository:

    wget http://www.dotdeb.org/dotdeb.gpg
    sudo apt-key add dotdeb.gpg
    

    Update the package index:

    sudo apt-get update
    

    Install php5-readline deb package:

    sudo apt-get install php5-readline
    
    0 讨论(0)
提交回复
热议问题