Skip to main content
added 57 characters in body
Source Link
Vantomas
  • 161
  • 1
  • 4

There is a much better way to recompile php with IMAP extension directly using Homebrew.

UPDATE 2023/0209: this procedure works even with the php8. Just use php instead of versioned formula [email protected]. Please note openssl has changed version to openssl@3.

  1. Run brew edit [email protected]

  2. Add depends_on "imap-uw" at the end of the depends_on section

  3. Check which version of openssl is in the depends_on section

  4. Add --with-imap=#{Formula["imap-uw"].opt_prefix} at the end of the --with section

  5. Add --with-imap-ssl=#{Formula["[email protected]"].opt_prefix} after --with-imap. Check sure it is the same version as in the depends_on section

  6. Run HOMEBREW_NO_INSTALL_FROM_API=1 brew reinstall --build-from-source [email protected]
    UPDATE 2023/02: If you dont prepend with HOMEBREW_NO_INSTALL_FROM_API=1, then modified file is not used. Behavior changed from 2023/01, more on https://github.com/Homebrew/brew/pull/14412

  7. It is not necessary to enable the php_imap.so extension in php.ini, because it is already compiled into PHP. You can check phpinfo();

In case of a formula update in the feature, just edit the formula again and reinstall with --build-from-source.

There is a much better way to recompile php with IMAP extension directly using Homebrew.

UPDATE 2023/02: this procedure works even with the php8. Just use php instead of versioned formula [email protected]

  1. Run brew edit [email protected]

  2. Add depends_on "imap-uw" at the end of the depends_on section

  3. Check which version of openssl is in the depends_on section

  4. Add --with-imap=#{Formula["imap-uw"].opt_prefix} at the end of the --with section

  5. Add --with-imap-ssl=#{Formula["[email protected]"].opt_prefix} after --with-imap. Check sure it is the same version as in the depends_on section

  6. Run HOMEBREW_NO_INSTALL_FROM_API=1 brew reinstall --build-from-source [email protected]
    UPDATE 2023/02: If you dont prepend with HOMEBREW_NO_INSTALL_FROM_API=1, then modified file is not used. Behavior changed from 2023/01, more on https://github.com/Homebrew/brew/pull/14412

  7. It is not necessary to enable the php_imap.so extension in php.ini, because it is already compiled into PHP. You can check phpinfo();

In case of a formula update in the feature, just edit the formula again and reinstall with --build-from-source.

There is a much better way to recompile php with IMAP extension directly using Homebrew.

UPDATE 2023/09: this procedure works even with the php8. Just use php instead of versioned formula [email protected]. Please note openssl has changed version to openssl@3.

  1. Run brew edit [email protected]

  2. Add depends_on "imap-uw" at the end of the depends_on section

  3. Check which version of openssl is in the depends_on section

  4. Add --with-imap=#{Formula["imap-uw"].opt_prefix} at the end of the --with section

  5. Add --with-imap-ssl=#{Formula["[email protected]"].opt_prefix} after --with-imap. Check sure it is the same version as in the depends_on section

  6. Run HOMEBREW_NO_INSTALL_FROM_API=1 brew reinstall --build-from-source [email protected]
    UPDATE 2023/02: If you dont prepend with HOMEBREW_NO_INSTALL_FROM_API=1, then modified file is not used. Behavior changed from 2023/01, more on https://github.com/Homebrew/brew/pull/14412

  7. It is not necessary to enable the php_imap.so extension in php.ini, because it is already compiled into PHP. You can check phpinfo();

In case of a formula update in the feature, just edit the formula again and reinstall with --build-from-source.

update for new version of php and behavior change in homebrew
Source Link
Vantomas
  • 161
  • 1
  • 4

There is a much better way to recompile php with IMAP extension directly using Homebrew.

UPDATE 2023/02: this procedure works even with the php8. Just use php instead of versioned formula [email protected]

  1. Run brew edit [email protected]

  2. Add depends_on "imap-uw" at the end of the depends_on section

  3. Check which version of openssl is in the depends_on section

  4. Add --with-imap=#{Formula["imap-uw"].opt_prefix} at the end of the --with section

  5. Add --with-imap-ssl=#{Formula["[email protected]"].opt_prefix} after --with-imap. Check sure it is the same version as in the depends_on section

  6. Run brewHOMEBREW_NO_INSTALL_FROM_API=1 brew reinstall --build-from-source [email protected]
    UPDATE 2023/02: If you dont prepend with HOMEBREW_NO_INSTALL_FROM_API=1, then modified file is not used. Behavior changed from 2023/01, more on https://github.com/Homebrew/brew/pull/14412

  7. It is not necessary to enable the php_imap.so extension in php.ini, because it is already compiled into PHP. You can check phpinfo();

In case of a formula update in the feature, just edit the formula again and reinstall with --build-from-source.

There is a much better way to recompile php with IMAP extension directly using Homebrew.

  1. Run brew edit [email protected]

  2. Add depends_on "imap-uw" at the end of the depends_on section

  3. Check which version of openssl is in the depends_on section

  4. Add --with-imap=#{Formula["imap-uw"].opt_prefix} at the end of the --with section

  5. Add --with-imap-ssl=#{Formula["[email protected]"].opt_prefix} after --with-imap. Check sure it is the same version as in the depends_on section

  6. Run brew reinstall --build-from-source [email protected]

  7. It is not necessary to enable the php_imap.so extension in php.ini, because it is already compiled into PHP. You can check phpinfo();

In case of a formula update in the feature, just edit the formula again and reinstall with --build-from-source.

There is a much better way to recompile php with IMAP extension directly using Homebrew.

UPDATE 2023/02: this procedure works even with the php8. Just use php instead of versioned formula [email protected]

  1. Run brew edit [email protected]

  2. Add depends_on "imap-uw" at the end of the depends_on section

  3. Check which version of openssl is in the depends_on section

  4. Add --with-imap=#{Formula["imap-uw"].opt_prefix} at the end of the --with section

  5. Add --with-imap-ssl=#{Formula["[email protected]"].opt_prefix} after --with-imap. Check sure it is the same version as in the depends_on section

  6. Run HOMEBREW_NO_INSTALL_FROM_API=1 brew reinstall --build-from-source [email protected]
    UPDATE 2023/02: If you dont prepend with HOMEBREW_NO_INSTALL_FROM_API=1, then modified file is not used. Behavior changed from 2023/01, more on https://github.com/Homebrew/brew/pull/14412

  7. It is not necessary to enable the php_imap.so extension in php.ini, because it is already compiled into PHP. You can check phpinfo();

In case of a formula update in the feature, just edit the formula again and reinstall with --build-from-source.

Source Link
Vantomas
  • 161
  • 1
  • 4

There is a much better way to recompile php with IMAP extension directly using Homebrew.

  1. Run brew edit [email protected]

  2. Add depends_on "imap-uw" at the end of the depends_on section

  3. Check which version of openssl is in the depends_on section

  4. Add --with-imap=#{Formula["imap-uw"].opt_prefix} at the end of the --with section

  5. Add --with-imap-ssl=#{Formula["[email protected]"].opt_prefix} after --with-imap. Check sure it is the same version as in the depends_on section

  6. Run brew reinstall --build-from-source [email protected]

  7. It is not necessary to enable the php_imap.so extension in php.ini, because it is already compiled into PHP. You can check phpinfo();

In case of a formula update in the feature, just edit the formula again and reinstall with --build-from-source.