0
namespace App\lara;

use SoapClient;
use StdClass;

class abrLookup extends SoapClient {

    private $guid = "xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx"; 

    public function __construct()
    {
        $params = array(
            'soap_version' => SOAP_1_1,
            'exceptions' => true,
            'trace' => 1,
            'cache_wsdl' => WSDL_CACHE_NONE
        ); 

Error

"Class 'SoapClient' not found"

I am trying to extend this class for however it is saying soap client not found, I am using php 7.2. I have went into my Apache and php setting and enabled the extension and looked up the php settings and it is enabled.

soap

Soap Client => enabled
Soap Server => enabled

Directive => Local Value => Master Value
soap.wsdl_cache => 1 => 1
soap.wsdl_cache_dir => /tmp => /tmp
soap.wsdl_cache_enabled => 1 => 1
soap.wsdl_cache_limit => 5 => 5
soap.wsdl_cache_ttl => 86400 => 86400

I then thought it was a laravel problem so i restarted the server and ran these commands

php artisan config:cache

php artisan config:clear

However i'm still where I started and clueless on how to resolve this issue, this is running on Ubuntu - php V7.2

Kai Mc
  • 21
  • 7
  • Check `Soap` module is installed or not – Mahesh.D Jul 09 '18 at 07:43
  • May be this [link](https://stackoverflow.com/a/22397686/1111502) helpful – Mahesh.D Jul 09 '18 at 07:48
  • Yeah i saw that post as well was digging around for a few hours before i posted on here I checked and the module is installed i do have several versions of PHP but i triple checked that i was using 7.2 thank you for posting the link though – Kai Mc Jul 09 '18 at 07:55
  • dump the autoloader maybe? If you added Soap later. `composer dump-autoload` – demo Jul 09 '18 at 11:09

1 Answers1

0

When you call SoapClient don't forget to use the global namespace : https://www.php.net/manual/en/language.namespaces.global.php

use \SoapClient;
Dae
  • 11
  • 5