0

I want to use SoapClient but it returns error: Class 'SoapClient' not found. I have windows+xampp and in my php.ini I coludn't find ;extension=php_soap.dll to uncomment it in order to enable that so I added it in extension=php_soap.dll. It didn't work. I created a new php file to use pure php code there: var_dump(new SoapClient($url)) so it didn't return error but got result correctly. So I got that the problem might be from namespace but when I put a backslash before SoapClient, it should work isn't it?

And here is my code:

namespace App\Http\Controllers\Gateways;
use App\Http\Controllers\Controller;
use \SoapClient;

class BankController extends GatewayController {
    public function requestGateway() {
        ...
        $client = new SoapClient($url);
    }
}
kodfire
  • 1,612
  • 3
  • 18
  • 57
  • 3
    Possible duplicate of [Fatal error: Class 'SoapClient' not found](https://stackoverflow.com/questions/11391442/fatal-error-class-soapclient-not-found) – Jerodev Jul 21 '19 at 12:27
  • Because I was using Laravel, I have used `php artisan serve` command. So when I stopped it with `ctrl+c` (Windows) and start it again it worked, – kodfire Jul 21 '19 at 16:43

0 Answers0