alternative to php HttpRequest

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dhruvg
Forum Newbie
Posts: 3
Joined: Sun Dec 27, 2009 11:44 pm

alternative to php HttpRequest

Post by dhruvg »

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
User avatar
manohoo
Forum Contributor
Posts: 201
Joined: Wed Dec 23, 2009 12:28 pm

Re: alternative to php HttpRequest

Post by manohoo »

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
dhruvg
Forum Newbie
Posts: 3
Joined: Sun Dec 27, 2009 11:44 pm

Re: alternative to php HttpRequest

Post by dhruvg »

Maybe I am not understanding the purpose of your response correctly, but how does this help me solve my problem.

Thanks in advance.
User avatar
manohoo
Forum Contributor
Posts: 201
Joined: Wed Dec 23, 2009 12:28 pm

Re: alternative to php HttpRequest

Post by manohoo »

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?
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: alternative to php HttpRequest

Post by Eran »

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.
Post Reply