Trouble with http get on VPS
I am relatively new to VPS and still coming up the learning curve.
I have root access and can use WHM and SSH.
My php code needs to do "http get" and pass some parameters as part of the url. Back when I was on a shared server all I had to do was turn on an extension called "http.so". But that utility does not appear to be readily available now that I am on VPS.
Using WHM and the Module Installer I installed HTTP_Request2. That module has the file Request2.php which includes the "http get" ability that I need. Below you will see the install messages.
WHM "Module Installers" claims that HTTP_Request2 is now installed. However, after the install I used SSH and did the following "find" command: find . -name Request2.php This "find" command returned nothing which seems to indicate that the file Request2.php was not installed. This same "find" command does locate files that I know are on my server. I restarted apache whenever I changed things. The documentation for HTTP_Request2 includes a simple php script that uses the "http get" feature. When I run that script the following error message appears in the log.
Here is the PATH from the WHM PHP Configuration Editor ./usr/local/lib/php/HTTP:/usr/lib/php:/home/mapping1/bin:/usr/local/lib:/usr/lib64/php/modules Below is the requested grep output
As a someone still learning this stuff I am likely missing something. Any clues?
pear/HTTP_Request2 can optionally use PHP extension "fileinfo"
downloading HTTP_Request2-2.3.0.tgz ...
Starting to download HTTP_Request2-2.3.0.tgz (119,717 bytes)
..........................done: 119,717 bytes
downloading Net_URL2-2.2.1.tgz ...
Starting to download Net_URL2-2.2.1.tgz (20,010 bytes)
...done: 20,010 bytes
install ok: channel://pear.php.net/Net_URL2-2.2.1
install ok: channel://pear.php.net/HTTP_Request2-2.3.0
WHM "Module Installers" claims that HTTP_Request2 is now installed. However, after the install I used SSH and did the following "find" command: find . -name Request2.php This "find" command returned nothing which seems to indicate that the file Request2.php was not installed. This same "find" command does locate files that I know are on my server. I restarted apache whenever I changed things. The documentation for HTTP_Request2 includes a simple php script that uses the "http get" feature. When I run that script the following error message appears in the log.
[26-Jun-2016 17:01:18 America/Denver] PHP Warning: require_once(HTTP/Request2.php): failed to open stream: No such file or directory in /home/mapping1/public_html/findmesar/test/get_test_03.php on line 2
[26-Jun-2016 17:01:18 America/Denver] PHP Fatal error: require_once(): Failed opening required 'HTTP/Request2.php' (include_path='./usr/local/lib/php/HTTP:/usr/lib/php:/home/mapping1/bin:/usr/local/lib:/usr/lib64/php/modules') in /home/mapping1/public_html/findmesar/test/get_test_03.php on line 2Here is the PATH from the WHM PHP Configuration Editor ./usr/local/lib/php/HTTP:/usr/lib/php:/home/mapping1/bin:/usr/local/lib:/usr/lib64/php/modules Below is the requested grep output
/etc/redhat-release:CentOS release 6.8 (Final)
/usr/local/cpanel/version:11.56.0.24
/var/cpanel/envtype:kvm
CPANEL=release
/usr/sbin/httpd: line 63: ulimit: open files: cannot modify limit: Operation not permitted
/usr/sbin/httpd: line 64: ulimit: open files: cannot modify limit: Operation not permitted
/usr/sbin/httpd: line 65: ulimit: open files: cannot modify limit: Operation not permitted
Server version: Apache/2.2.31 (Unix)
Server built: Apr 26 2016 18:49:55
Cpanel::Easy::Apache v3.32.12 rev9999
PHP 5.6.20 (cli) (built: Apr 26 2016 19:04:06)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with the ionCube PHP Loader v4.7.5, Copyright (c) 2002-2014, by ionCube Ltd., and
with Zend Guard Loader v3.3, Copyright (c) 1998-2014, by Zend Technologies
mysql Ver 14.14 Distrib 5.6.30, for Linux (x86_64) using EditLine wrapperAs a someone still learning this stuff I am likely missing something. Any clues?
-
Also magic user loader is disabled. 0 -
If you're seeing the warning regarding HTTP, then it's not installed. Go into WHM, search for 'pear' . Look at both the pear and pecl modules. Is it in there? 0 -
Yes, when I use WHM and look at the installed pear modules, that list includes HTTP_Request2. The documentation for HTTP_Request2 includes a short php script that does a 'http get'. When I run that script I get the error message I posted which includes the statement "require_once(HTTP/Request2.php): failed to open stream: No such file or directory". If by installing HTTP_Request2 the file Request2.php was supposed to be placed on my server then I cannot 'find' that file by using SSH. 0 -
Let's not spend amy more time on this. I think I can use Curl for what I need to do. 0 -
Hello, I'm happy to see you were able to proceed with cURL as an alternative. Feel free to provide an example of the test script you were using for HTTP_Request2 if you want us to take a closer look. Thank you. 0
Please sign in to leave a comment.
Comments
5 comments