Fatal error: Call to undefined function pcntl_signal()
0xdevalias opened this issue · 5 comments
⇒ php s3-buckets-bruteforcer.php --bucket ~/Desktop/buckets.txt
11 buckets to test.
Fatal error: Call to undefined function pcntl_signal() in /Users/foo/sec/s3-buckets-finder/BucketBruteForcer.php on line 304
http://php.net/manual/en/function.pcntl-signal.php
This is using the default php on macOS:
⇒ php --version
PHP 5.6.25 (cli) (built: Sep 19 2016 15:45:41)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
Take a look at your php.ini, sometimes those functions are disabled.
Tried: brew install homebrew/php/php55-pcntl
But get the following error when trying to run with it:
foo@bar:~/sec/s3-buckets-finder|add-dockerfile
⇒ /usr/local/opt/php55/bin/php ./s3-buckets-bruteforcer.php
PHP Warning: Module 'pcntl' already loaded in Unknown on line 0
Warning: Module 'pcntl' already loaded in Unknown on line 0
PHP Fatal error: Arrays are not allowed in class constants in /Users/foo/sec/s3-buckets-finder/BucketBruteForcer.php on line 26
Fatal error: Arrays are not allowed in class constants in /Users/foo/sec/s3-buckets-finder/BucketBruteForcer.php on line 26
Edit: This seems more promising: brew install homebrew/php/php71-pcntl
But then I still get a number of warnings:
⇒ $(brew --prefix homebrew/php/php71)/bin/php ./s3-buckets-bruteforcer.php --bucket ~/Desktop/buckets.txt
PHP Warning: Module 'pcntl' already loaded in Unknown on line 0
Warning: Module 'pcntl' already loaded in Unknown on line 0
11 buckets to test.
PHP Warning: Illegal offset type in isset or empty in /Users/foo/sec/s3-buckets-finder/BucketBruteForcer.php on line 221
PHP Warning: Illegal offset type in /Users/foo/sec/s3-buckets-finder/BucketBruteForcer.php on line 234
PHP Warning: Illegal offset type in isset or empty in /Users/foo/sec/s3-buckets-finder/BucketBruteForcer.php on line 221
..etc..
Is there a specific php version I should be trying to use this with?
Sorry but I will not rewrite my script to fit old PHP versions unless it affords a great value. You can alter it by yourself or upgrade your PHP.
I'm not asking you to rewrite it for an old version. I just want to know which version it's written for, and thus what I should be trying to use. In my edit above, I tried it against 7.1 and am still getting issues.
It's not written for a specific version.
Works perfectly with PHP 5.6.30 and PHP 7.0.15, fresh install, no change in php.ini.
Cool. I will try 7.0.x and see how it goes.
Edit: Yeah, awesome. 7.0.x works perfectly. Thanks!
In case it helps anyone else on OSX: brew install homebrew/php/php70-pcntl
$(brew --prefix homebrew/php/php70)/bin/php ./s3-buckets-bruteforcer.php --bucket ~/Desktop/buckets.txt