phphttp-request2

failed to open stream. no such file or directory Request2.php


I am using Ubuntu 19.10 and have installed pear/Request2 using sudo pear install http_request2. I am trying to use it inside my PHP file while sending a request to Azure Face API but it is giving me the following error.

Warning: require_once(HTTP/Request2.php): failed to open stream: No such file or directory in /opt/lampp/htdocs/php_to_flutter/create_face_list.php on line 3

Fatal error: require_once(): Failed opening required 'HTTP/Request2.php' (include_path='.:/opt/lampp/lib/php') in /opt/lampp/htdocs/php_to_flutter/create_face_list.php on line 3

I have verified that the required files are available at

/usr/share/php/HTTP

but it isn't picking them. How am I supposed to resolve it? Thanks


Solution

  • I have resolved the issue. It might not be an efficient solution but it worked for me. Here are the steps

    1. copied Net folder to HTTP folder
    2. copied HTTP folder from /usr/share/php to my htdocs where my .php files were saved.
      Boom!!! It worked perfectly fine. If anyone has any other solution, please share it. I'll try that too. Thanks