Fedora broke my PHP code when moving from ubuntu

Note: This is an unfinished post. I don't plan to finish it. Thought it might be helpful anyway

Diagnosing the problem

  • cd /etc/httpd; sudo gedit logs/error_log;
    • this will tell you your server-errors

Installing and enabling mod_php

  • Follow one of (these tutorials......) to install PHP properly. It's probably safe to assume that you've already done this...
  • cd /etc/httpd
  • sudo ls modules
  • look for libphp7.so (or whichever PHP version). There may be an additional libphp7 like libphp7-zts.so. When I used libphp7.so, I got the following error:
    • Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe.
  • But when I configured with the -zts, it worked!
  • You're already in /etc/httpd so cd conf.d
  • sudo gedit user_settings.conf (or whatever file name you prefer)
  • Write the following:
    • LoadModule php7_module modules/libphp7-zts.so
  • Now your PHP SHOULD be back to normal

Some queries and related problems & links??:

Several StackOverflow posts about... kind of this topic. I think I could assume the lack of mod_php caused the problem

  • sudo dnf install php-posix
    • fixed: Call to undefined function posix_getuid()
    • https://www.php.net/manual/en/function.posix-geteuid.php
  • enable mod_php in fedora
  • httpd enable mod_php
  • apache_response_headers function / Probably apache_request_headers
    • https://www.php.net/manual/en/function.apache-response-headers.php
  • .htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
  • Fatal error: Uncaught Error: Call to undefined function apache_response_headers() in
  • Fedora, HTTPD, apache