Apache MPM perfork problem

I have a trouble with apache, when it start I get this error and I already try to enable
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
but doesn’t work. What I need to do to make it work?

Starting apache…[Thu Jun 13 06:27:50.652218 2024] [php7:crit] [pid 79600:tid 140715372424064] Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP.
AH00013: Pre-configuration failed

Which versions?
What is your goal?

Your question is inconsistent.
prefork is NOT a threaded MPM, so you cannot have this error

The default configuration is designed to work out of the box

  • EL-7 was using prefork MPM with mod_php
  • EL-8 uses event MPM (threaded) with php-fpm (mod_php is still there, and used with prefork)
  • EL-9 uses event MPM (threaded) with php-fpm (mod_php is no more provided)

In Rocky 8.x and 9.x, you don’t need to do anything. It’s ready to use out-of-the-box.