Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BORIS won't start #29

Closed
dangelov opened this issue May 8, 2013 · 9 comments
Closed

BORIS won't start #29

dangelov opened this issue May 8, 2013 · 9 comments

Comments

@dangelov
Copy link

dangelov commented May 8, 2013

I get the following error when I try to start it. I cloned the repo, cd'ed and tried to run it.

Dinos-MacBook-Pro:bin dinoangelov$ ./boris

Fatal error: Call to undefined function Boris\pcntl_signal() in /Users/dinoangelov/Library/Developer/boris/lib/Boris/Boris.php on line 110

@d11wtq
Copy link
Contributor

d11wtq commented May 8, 2013

You need a PHP that has been compiled with the pcntl functions to run Boris. The PHP that ships with OS X is notoriously lacking. Any of the mainstream Linux distros should provide suitable PHPs, otherwise you may install your own on OS X (which is what I do).

@d11wtq d11wtq closed this as completed May 8, 2013
@dangelov
Copy link
Author

dangelov commented May 9, 2013

In case some other people run into the same issue, here's a small guide I wrote for OS X. Feel free to grab the relevant bits or link to it if you'd like to add a bit more instructions for the OS X installation.

http://dangelov.com/setting-up-boris-on-mac-os-x

@juniorz
Copy link

juniorz commented Dec 16, 2013

Boris fails when running on a Docker container:

root@9c49cfac3925:/garage# php -m | grep readline
readline
root@9c49cfac3925:/garage# php -m | grep posix
posix
root@9c49cfac3925:/garage# php -m | grep pcntl
pcntl
root@9c49cfac3925:/garage# boris
PHP Warning:  pcntl_signal() has been disabled for security reasons in phar:///usr/local/bin/boris/lib/Boris/Boris.php on line 141
PHP Warning:  pcntl_fork() has been disabled for security reasons in phar:///usr/local/bin/boris/lib/Boris/Boris.php on line 148
PHP Notice:  fwrite(): send of 1 bytes failed with errno=32 Broken pipe in phar:///usr/local/bin/boris/lib/Boris/EvalWorker.php on line 205
PHP Fatal error:  Uncaught exception 'RuntimeException' with message 'Socket error: failed to write data' in phar:///usr/local/bin/boris/lib/Boris/EvalWorker.php:206
Stack trace:
#0 phar:///usr/local/bin/boris/lib/Boris/EvalWorker.php(88): Boris\EvalWorker->_write(Resource id #20, '?')
#1 phar:///usr/local/bin/boris/lib/Boris/Boris.php(171): Boris\EvalWorker->start()
#2 phar:///usr/local/bin/boris/bin/boris(15): Boris\Boris->start()
#3 /usr/local/bin/boris(10): require('phar:///usr/loc...')
#4 {main}
  thrown in phar:///usr/local/bin/boris/lib/Boris/EvalWorker.php on line 206

Is any special permission needed to use these PHP extensions boris require?

@chasingmaxwell
Copy link

@juniorz I just ran into the same problem. In my case I needed to remove the pcntl functions from disabled_functions in my php.ini.

@juniorz
Copy link

juniorz commented Jan 21, 2014

Thank you @chasingmaxwell. It worked with:

$ grep -E '^disable_functions' /etc/php5/cli/php.ini | sed -r 's/pcntl_(signal|fork|waitpid|signal_dispatch),//g' > /etc/php5/cli/conf.d/99-boris.ini

on an Ubuntu box.

@chadfurman
Copy link

phpinfo() shows php compiled with pcntl. running test.php with pcntl_signal() returns "expecting arguments...." instead of "function not found" so I know I have the function set. Moreover, I'm running PHP 5.4

I'm guessing this is boris's implementation involving namespaces that's triggering this error. It's not my PHP version.

the #!/usr/bin/php -q was forcing the wrong version of PHP. fixed the path, everything is fine.

@Charleezy
Copy link

I commented out the line in my php.ini and then restarted apache. No dice. I still get the error. Welp.

@Pysis868
Copy link

Pysis868 commented May 23, 2018

Since I found this page from Google searching my problem, a bit different from dangelov's message: PCNTL support seems to be missing or disabled. See https://github.com/d11wtq/boris/issues/29 for details

Went through some kind of upgrade on the Mac. I'm positive it was upgrades in (Home)brew when the php package/formula was being renamed to php@5.6, but somehow my shell started using the system /usr/bin/php, that mentioned above, lacks the compilation configuration to include PCNTL functions, along with many others.

I still had that PHP installed, but didn't have the paths set-up in my terminal (fish), so I just added them with the commands mentioned in the brew PHP package's info text.

Maybe I was using the system one this entire time until now, but that's strange because I was successfully using boris until this situation occurred.

@ernstki
Copy link

ernstki commented Jan 21, 2021

Hello from the future!

I discovered by way of this Stack Overflow answer that MacPorts and Homebrew both seem to have phpXY-pcntl packages available.

In my case, this let me use boris on my Mac running Mojave (10.14.6):

$ sudo port install php73-pcntl
--->  Computing dependencies for php73
⋮
--->  Some of the ports you installed have notes:
  php73 has the following notes:
    You may need to update your php.ini for any changes that have been made in this version of php73. Compare /opt/local/etc/php73/php.ini with
    /opt/local/etc/php73/php.ini-development (if this is a development server) or /opt/local/etc/php73/php.ini-production (if this is a production server).
  php73-pcntl has the following notes:
    php73-pcntl should not be enabled within a web server environment. Unexpected results may occur if any process control functions are used within a web server
    environment.

$ php -m | grep pcntl
pcntl

Note the warning that this version of PHP should not be used in a production environment, so just be aware of that. I'm only using the interpreter from the command line, so this was fine for me.

Hope this helps!


Update: It was also necessary to sudo port install php73-posix, otherwise I was getting errors like:

Fatal error: Uncaught Error: Call to undefined function Boris\posix_getpid() in /path/to/boris/lib/Boris/EvalWorker.php:113
Stack trace:
#0 /path/to/boris/lib/Boris/Boris.php(175): Boris\EvalWorker->start()
#1 /path/to/boris/bin/boris(18): Boris\Boris->start()
#2 {main}
  thrown in /path/to/boris/lib/Boris/EvalWorker.php on line 113

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants