Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

287
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda