Install SOAP Extension

I would like to use the PHP SOAP Extension.

But I don`t understand how to put it to vagrant provision for php7-fpm.

Can somebody help me?

I want to do something like
$client = new SoapClient($url, array("trace" => 1, "exception" => 0));

but i get
Uncaught Error: Class ‘SoapClient’ not found in

Related: Woocomerce and php7.0-soap and php7.0-mbstring

This PR shows an example of where to add additional packages:

Thank you! This was the fastest answer I ever got in an internet forum :slightly_smiling:


Hello dears.

I installed php7.2-soap on the already-provisioned staging and vagrant boxes with

sudo apt-get install php-soap

Does the following look correct for Trellis config?

# roles/php/defaults/main.yml
  php7.2-soap:  "{{ apt_package_state }}"

Please utilize Ansible… you almost never want to run commands like that on your servers. You should be modifying your configuration and then provisioning again. There is no harm in provisioning servers again. That is how you should be applying configuration changes :slight_smile:

You can define php_extensions_custom in group_vars/all/ rather than overriding that file, allowing you to more easily upgrade Trellis in the future


Would I do that by adding to group_vars/all/main.yml like shown here?

  php7.2-soap: "{{ apt_package_state }}"

And then would vagrant reload --provision do the trick locally?

Give it a shot and try before asking! :smiley:

(The answer is yes)