Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

285
Vistas
Apache 2.4, .htaccess and php directive error

I have upgraded to Centos 8, and find myself having to cope with the changes in Apache 2.4. I’ve started to get it working, but I have a perplexing error with a simple setting in .htaccess:

#   .htaccess
#   PHP Time Zone
    php_value date.timezone Australia/Melbourne

I get the dreaded error:

The server encountered an internal error or misconfiguration and was unable to complete your request.

There’s no point contacting the server administrator because that’s me.

The error_log file has this:

Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration

This has always worked in the past on Apache 2.4, and also works when I use Apache 2.4 on XAMPP. So obviously there is something in some other configuration, possibly in httpd.conf which causes it to crash.

What setting am I missing, or should I change?

Update

As answered by @Chi.C.J.RajeevaLochana below, the solution lies in using the correct MPM. In my case, in the file 00-mpm-conf:

  • Comment out

    LoadModule mpm_event_module modules/mod_mpm_event.so

  • Uncomment

    LoadModule mpm_prefork_module modules/mod_mpm_prefork.so

For further information, see:

  • https://wiki.archlinux.org/index.php/Apache_HTTP_Server#PHP
  • https://bugs.archlinux.org/task/39218
over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

When you are using either mod_mpm_event or mod_mpm_worker instead of mod_mpm_prefork, you will not be able to use the PHP Module. This is because mod_mpm_event and mod_mpm_worker are threaded modules. And the PHP module is not thread safe.

If you are unsure how to do this, check out Soufiane ELH's tutorial which should be above/below this answer.

over 4 years ago · Santiago Trujillo Denunciar

0

the event module is enabled by default on centos 8 .. to check wich module you have :

#sudo httpd -V | grep -i mpm

if you have enent module enabled, disable it, and enable the prefork module:

  • Edit the /etc/httpd/conf.modules.d/00-mpm.conf file
  • Comment out the line for the event module
  • uncomment the line for the prefork module
  • restart apache

check again the module enabled by apache and you will find prefork :

# sudo httpd -V | grep -i mpm
Server MPM:     prefork
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda