Hướng dẫn install php imap macos

Tôi đang sử dụng PHP 7.2 trên OS X El Capitan, được cài đặt bằng Homebrew (tất nhiên). Bây giờ tôi muốn sử dụng một số chức năng IMAP từ tiện ích mở rộng IMAP của PHP, nhưng bất kể tôi tìm kiếm gì, tôi không thể tìm cách thêm tiện ích mở rộng trên OSX.

Một số điều tôi đã thử ... Tất nhiên, tôi đã thử phương pháp được khuyên dùng phổ biến nhất:

$ brew reinstall php --with-imap

Nhưng điều này thất bại, trở lại:

Warning: php: this formula has no --with-imap option so it will be ignored!

Một phương pháp khác, mà tôi thấy được đề cập khi truyền, cũng thất bại:

$ brew install php72-imap

Error: No available formula with the name "php72-imap" 
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.

Tôi không chắc chắn chính xác hướng đi nào với điều này. Tôi chắc chắn có một cách dễ dàng, có thể được ghi lại, cách làm này, nhưng tôi vẫn chưa tìm thấy nó. Có lẽ tôi chỉ đang tìm sai chỗ và sử dụng thuật ngữ tìm kiếm sai ...

I have Apache server on Mac OS 10.8. I need module IMAP to be enabled in PHP. I followed this instruction http://blog.xeonxai.com/2009/12/03/160/. I have installed imap.so and link it in php.ini file like this

extension=/usr/lib/php/extensions/no-debug-non-zts-20090626/imap.so

But I cannot get IMAP modules when print out phpinfo() as well as imap_open function. What's wrong with my web server ?

Thanks for helping !

holdenweb

29.2k7 gold badges51 silver badges73 bronze badges

asked Feb 28, 2014 at 10:57

Hướng dẫn install php imap macos

3

This is what I did to have the IMAP module working:

  1. Install php56 with IMAP enabled using brew: brew install php56 --with-imap
  2. Edit http.conf and replace the line loading PHP (LoadModule php5_module libexec/apache2/libphp5.so) with the newly installed PHP: LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so
  3. Restart apache: sudo apachectl restart

answered Nov 23, 2015 at 21:12

Jesús CarreraJesús Carrera

11.1k4 gold badges62 silver badges55 bronze badges

2

Tôi đang sử dụng PHP 7.2 trên OS X El Capitan, được cài đặt bằng Homebrew (tất nhiên). Bây giờ tôi muốn sử dụng một số hàm IMAP từ tiện ích mở rộng IMAP của PHP, nhưng bất kể tôi tìm kiếm gì, tôi không thể tìm thấy cách thêm tiện ích mở rộng trên OSX.

Một số điều tôi đã thử ... Tất nhiên, tôi đã thử cách tiếp cận được đề xuất phổ biến nhất:

$ brew reinstall php --with-imap

Tuy nhiên, điều này không thành công, trả về:

Warning: php: this formula has no --with-imap option so it will be ignored!

Một phương pháp khác, mà tôi thấy đã đề cập khi vượt qua, cũng không thành công:

$ brew install php72-imap

Error: No available formula with the name "php72-imap" 
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.

Tôi không chắc chắn nên đi theo hướng nào với điều này. Tôi chắc rằng có một cách dễ dàng, có thể đã được ghi chép lại, để làm điều này, nhưng tôi vẫn chưa tìm ra nó. Có lẽ tôi chỉ đang tìm kiếm sai chỗ và sử dụng các cụm từ tìm kiếm sai ...

17 hữu ích 1 bình luận 18k xem chia sẻ