3

For some reason, my php extensions are enabled, but not loaded by my Apache 2.4 server. The extensions I am missing are mbstring and fileinfo. I did the installation manually and I wish to keep it that way, mostly for learning purposes.

When I say enabled, I mean that when I run php -m in cmd, the extensions are in the list

However, when I run <?php phpinfo(); from my server, these extensions are not in the list.

In my php.ini file, I have only configured the follwing (related to extensions):

extension_dir = "ext"
extension=mbstring (uncommented the line)
extension=fileinfo (uncommented the line)

I added the following to httpd.conf:

# PHP5 module
LoadModule php7_module "C:/php/php7apache2_4.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/php/"

And, in phpinfo(), I see only a single php.ini is loaded, the one from C:/php

Why would my extensions not be available on my Apache server? Do I have to load/enable them manually in Apache somehow?

*Versions: Apache 2.4.39, PHP 7.3.4

DCardinal
  • 131
  • 1
  • 3

1 Answers1

0

I am having the same problem with my own extensions outside of the normal Apache PHP type of configuration. What I found is if I don't use Apache as a service and I open a command console to start Apache, it will load. It's the only way it will load. Don't use a batch process or the service.

For Windows,

  1. press Winkey+R,
  2. type cmd,
  3. press Ctrl+Shift+Enter, and
  4. click "yes".
  5. Then, cd to your Apache/bin directory and type httpd.

I think if you do anything outside the norm, custom extensions won't work unless you build your own executables.