Roots Discourse

Install SOAP Extension


#1

I would like to use the PHP SOAP Extension.
http://php.net/manual/de/class.soapclient.php

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


#2

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

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


#3

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


#4

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
  php_extensions_custom:
  php7.2-soap:  "{{ apt_package_state }}"

#5

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


#6

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

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

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


#7

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

(The answer is yes)


#8