[wp-trac] [WordPress Trac] #56010: apache_mod_loaded returns fatal TypeError in some environments with PHP 8

WordPress Trac noreply at wordpress.org
Sat Sep 24 13:51:36 UTC 2022


#56010: apache_mod_loaded returns fatal TypeError in some environments with PHP 8
-----------------------------------+-----------------------------
 Reporter:  engahmeds3ed           |       Owner:  SergeyBiryukov
     Type:  defect (bug)           |      Status:  closed
 Priority:  normal                 |   Milestone:  6.1
Component:  General                |     Version:
 Severity:  major                  |  Resolution:  fixed
 Keywords:  php8 has-patch commit  |     Focuses:
-----------------------------------+-----------------------------
Changes (by SergeyBiryukov):

 * owner:  (none) => SergeyBiryukov
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"54299" 54299]:
 {{{
 #!CommitTicketReference repository="" revision="54299"
 General: Correct the fallback logic in `apache_mod_loaded()`.

 If the `apache_get_modules()` function is redeclared to return an empty
 array, `apache_mod_loaded()` would assume that no Apache modules are
 installed and activated, which may not be correct.

 This commit improves the logic by using pre-existing `phpinfo()` fallback
 to check for loaded modules in that case.

 Includes replacing a hardcoded number passed as a flag to `phpinfo()` with
 the `INFO_MODULES` predefined constant for clarity.

 Follow-up to [7441], [7508], [29330].

 Props engahmeds3ed, audrasjb, Clorith, SergeyBiryukov.
 Fixes #56010.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56010#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list