1

I have some example code, at the top of the code is:

require_once('./lib/soap.php');

But get the following error:

Warning: require_once(./lib/soap.php): failed to open stream: No such file or directory in /var/www/vhosts/site.com/httpdocs/test.php on line 1

I'm using PHP7.0.27 and the soap extension is installed and enabled by default and located on the server in directory /opt/plesk/php/7.0/lib/php/modules/soap.so

But I can't find the soap.php, I've tried searching via SSH with:

find . soap.php

But that returns

find: ‘soap.php’: No such file or directory

I've checked the answer at:

PHP - Failed to open stream : No such file or directory

But as I can't find the soap.php file, I'm stuck on what my next step should be. Do I need to set up a whole new soap server as described in this tutorial: https://www.youtube.com/watch?v=e_7jDqN2A-Y or is there a much simpler way of doing this?

Thank you.

GibsonFX
  • 1,000
  • 2
  • 10
  • 33
  • 4
    If you're just trying to use the SOAP extension, and you've confirmed that it is installed and enabled, you do not need to add any `require` statements in your code. The extension is available to use just like the rest of PHP's core. – Aken Roberts Feb 23 '18 at 23:22
  • If you make that into an answer I'll mark it as correct. – GibsonFX Feb 23 '18 at 23:31

3 Answers3

4

If you're just trying to use the SOAP extension, and you've confirmed that it is installed and enabled, you do not need to add any require statements in your code. The extension is available to use just like the rest of PHP's core.

For others unsure if an extension is loaded, this SO Q&A has a handful of methods for checking.

Aken Roberts
  • 13,012
  • 3
  • 34
  • 40
1

if it is already being loaded as an extension in PHP, why do you want to include it in your file instead of directly accessing it?

harry
  • 29
  • 3
  • I did consider this, but as it's in the example code I wasn't sure. If that's the case that I don't need to call it. great that answers my question. – GibsonFX Feb 23 '18 at 23:30
0

try:

find DIRECTORYTOSTARTSEARCH -name soap.php -type f

That is the correct way of using find command. If you want to search within the whole filesystem use:

sudo find / -name soap.php -type f
Gustavo Topete
  • 1,246
  • 1
  • 9
  • 15