Does anyone know how to enable a PHP extension within the .htaccess
file?
Possibly:
(.htaccess file)
php_value extension=php_soap.so
Does anyone know how to enable a PHP extension within the .htaccess
file?
Possibly:
(.htaccess file)
php_value extension=php_soap.so
It's exactly the same syntax as Apache's httpd.conf, so it's:
LoadModule php_soap modules/php_soap.so
(for the "modules" bit, I'm assuming you're using the normal modules directory from /etc/httpd. If not, put that directory in it's place.) (Wrong)
It's not a module, as I'd originally thought, but a php extension. Extensions have the following syntax:
extension=soap.so (also wrong)
Apparently it's:
php_extension soap.so
Got that from this thread in a Drupal forum. Ymmv. I'm going home now, since clearly my brain is shot for the day.
Also, make sure you allow for override, or the webserver will ignore your .htaccess file.
According to the manual the extension keywork can only be used in the php.ini file.
But you could do this in your .htaccess file....
php_value auto_prepend_file /path/to/loadsoap.php
....and in /path/to/loadsoap.php...
<?php
dl(init_get("extension_dir") . "/php_soup.so");
it depends on your php version and your OS.
e.g. in older php versions you must do
php_value php_extension php_curl.so
in linux and
php_value php_extension php_curl.so
in windows. But in php 7 you can do
php_value php_extension curl
and it works for windows and linux as well. For the php versions you could add blocks like this:
<IfModule mod_php5.c>
php_value php_extension php_curl.so
</IfModule>
<IfModule mod_php7.c>
php_value php_extension curl
</IfModule>
But unfortunally I dont know a way to check for windows or linux in .htaccess.
So you must eccept that the most hosted servers are linux you have the rar situation that your server runs in windows. you must change php_curl.so
into php_curl.dll
UPDATE:
I noticed today, that php_value php_extension curl
has no effect on the modules when using Apache/2.4.41 (Win64)
and PHP/7.3.13
, I am not sure which versions are affected by this problem.