当前位置:网站首页>The solution to the lack of pcntl extension under MAMP, fatal error: call to undefined function pcntl_ signal()

The solution to the lack of pcntl extension under MAMP, fatal error: call to undefined function pcntl_ signal()

2022-07-04 22:58:00 Song Xiaoyu

mac By default, the self-contained PHP, Cause configuration mamp Of PHP Never succeed

1. How to use the default PHP Replace with mamp Integrated environment PHP

  • modify bash Configuration in
 //  Open profile 
  vim .bash_profile

  //  Add the configuration 
  export PATH="/Applications/MAMP/bin/php/php7.1.20/bin:$PATH"

  //  Profile validation 
  source .bash_profile
  • modify zsh Configuration in
  //  Open profile 
  vim .zshrc

  //  Add the configuration 
  export PATH="/Applications/MAMP/bin/php/php7.1.20/bin:$PATH"

  //  Profile validation   There are still questions 
  source .zshrc

2. add to pcntl Expand

  1. Download the corresponding version of PHP http://www.php.net/releases/
  2. Unzip the file tar -xzvf php-7.1.20.tar.gz
  3. Get into pcntl Catalog cd php-7.1.20/ext/pcntl
  4. Conduct phpize variation /Applications/MAMP/bin/php/php7.1.20/bin/phpize
  5. Carry out orders ./configure
    –with-php-config=/Applications/MAMP/bin/php/php7.1.20/bin/php-config --prefix=/Applications/MAMP/bin/php/php7.1.20/bin/php
  6. make compile `make && make install
  7. The terminal displays the following information , That is success
Installing shared extensions:     /Applications/MAMP/bin/php/php7.1.20/lib/php/extensions/no-debug-non-zts-20170718/
  1. open mamp Corresponding version php The configuration file of add extension=pcntl.so
MAMP PRO menu->File ->Edit Template->PHP->7.1.20
  1. perform php --ri pcntl after , Terminal display pcntl pcntl support => enabled That's it .

Reference documents
https://www.jianshu.com/p/ec88a61a0fa8

https://stackoverflow.com/questions/47806090/how-to-enable-pcntl-extensions-in-mamp-pro/50266295

原网站

版权声明
本文为[Song Xiaoyu]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/185/202207042230011356.html