I was using the HttpRequest class in my php script, but when I uploaded this script to my hosting provider's server, I get a fatal error when executing it:
Fatal error: Class 'HttpRequest' not found in ... on line 87
I believe the reason is because my hosting provider's php.ini configuration doesnt include the extension that supports HttpRequest.
I am making this script for many different users (which they will use on their websites) and I don't want to depend on their hosting provider's php.ini configuration for my script to work. That said, is there a workaround to HttpRequest in php that is supported by most, if not all, hosting providers which I can use to send HTTP requests? A more ubiquitous alternative?
Thanks in advance.
Dhruv
alternative to php HttpRequest
Moderator: General Moderators
Re: alternative to php HttpRequest
All PHP variables are case sensitive. These are the superglobals:
* $GLOBALS — References all variables available in global scope
* $_SERVER — Server and execution environment information
* $_GET — HTTP GET variables
* $_POST — HTTP POST variables
* $_FILES — HTTP File Upload variables
* $_REQUEST — HTTP Request variables
* $_SESSION — Session variables
* $_ENV — Environment variables
* $_COOKIE — HTTP Cookies
For more information go to:
http://php.net/manual/en/reserved.variables.php
* $GLOBALS — References all variables available in global scope
* $_SERVER — Server and execution environment information
* $_GET — HTTP GET variables
* $_POST — HTTP POST variables
* $_FILES — HTTP File Upload variables
* $_REQUEST — HTTP Request variables
* $_SESSION — Session variables
* $_ENV — Environment variables
* $_COOKIE — HTTP Cookies
For more information go to:
http://php.net/manual/en/reserved.variables.php
Re: alternative to php HttpRequest
Maybe I am not understanding the purpose of your response correctly, but how does this help me solve my problem.
Thanks in advance.
Thanks in advance.
Re: alternative to php HttpRequest
my mistake, I didn't read your post properly.
It seems that your provider has made changes to the default .ini file. Have you contacted them?
It seems that your provider has made changes to the default .ini file. Have you contacted them?
Re: alternative to php HttpRequest
There is no ini setting that can disable this class. Most probably the version of PHP on the server is too old and does not include it. HttpRequest has only been available since PHP 5.0 and HttpResponse has been available since PHP 5.1. Check the version of PHP installed on your server.