goplutus Posted December 7, 2010 Share Posted December 7, 2010 I'm trying to integrate w/ a few APIs, and getting started is causing me fits. I'm using PHP locally to add common headers and as a contact form, and those are working fine. The Code: <?php require('HTTP/Request.php'); $url = "http://example.com"; $request =& new HTTP_Request($url); $request->sendRequest(); $response = $request->getResponseBody(); ?> The Result: Warning: require(HTTP/Request.php) [function.require]: failed to open stream: No such file or directory in /home/stodgy5/public_html/trackstart/start.php on line 3 Warning: require(HTTP/Request.php) [function.require]: failed to open stream: No such file or directory in /home/stodgy5/public_html/trackstart/start.php on line 3 Fatal error: require() [function.require]: Failed opening required 'HTTP/Request.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/stodgy5/php') in /home/stodgy5/public_html/trackstart/start.php on line 3 I'm assuming this is a directory issue, as my cPanel says Pear is installed. Any advice? Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted December 7, 2010 Share Posted December 7, 2010 in the same directory as the script, is there a directory called HTTP and within that a file called Request.php? because that is what this is requiring: require('HTTP/Request.php'); Quote Link to comment Share on other sites More sharing options...
JakeTheSnake3.0 Posted December 7, 2010 Share Posted December 7, 2010 Where is "Request.php" stored on the server? Here's what happens with your require() line... PHP will search in any of the include_paths for "request.php" as well as the current working directory. So it will search: 1) /usr/lib/php/Request.php 2) /usr/local/lib/php/Request.php 3) /home/stodgy5/php/Request.php 4) /home/stodgy5/public_html/trackstart/Request.php If it doesn't find the file in any of those locations it will fail. Quote Link to comment Share on other sites More sharing options...
goplutus Posted December 7, 2010 Author Share Posted December 7, 2010 thanks for the help, request needed a "2" on it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.