skip to Main Content

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.

3

Answers


  1. 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
    
    Login or Signup to reply.
  2. 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?

    Login or Signup to reply.
  3. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search