"PHP Fatal Error: Class 'Httprequest' Not Found"

PHP Fatal error: Class 'HttpRequest' not found

If you look down the list here: http://downloads.php.net/pierre/ you'll see 4 versions of php_http. The 4 versions are all options of 'non-thread-safe' and 'thread-safe' (filename shows 'nts' or nothing), and VC6 or VC9.

To see if you need vc6 or vc9, load up phpinfo, and look at 'Compiler' near the top. A bit further down, you'll see 'Thread Safety' if this is enabled, go for the one that doesn't say 'nts'.

Fatal error: Class 'HttpRequest' not found in C:\xampp\htdocs\test

Ok say you have a file HttpRequest.php in the same folder and in that file is

 class HttpRequest {
...
}

Then somewhere before calling it, you need to tell php about it. This is done using one of four ways, but I would do it this way

require_once __DIR__.'/HttpRequest.php'; //assuming it's in the same folder.

Remember this isn't magic, it's just computer code. It only knows what you tell it. I would also hope that the place you got the code from would have some kind of basic instructions on how to install set it up, and that you read that.

Now not to confuse you but the choices are

include
include_once
require
require_once

I only put these here to illustrate that, things ( generally ) mean what they say in programing. So include, includes it, adding *_once, only does it once, and require will throw an error if it's not found in the location specified, thus making it required. Whereas include doesn't really care if it was actually included or not.

Good Luck! happy coding.

Are memory leaks ever ok?

No.

As professionals, the question we should not be asking ourselves is, "Is it ever OK to do this?" but rather "Is there ever a good reason to do this?" And "hunting down that memory leak is a pain" isn't a good reason.

I like to keep things simple. And the simple rule is that my program should have no memory leaks.

That makes my life simple, too. If I detect a memory leak, I eliminate it, rather than run through some elaborate decision tree structure to determine whether it's an "acceptable" memory leak.

It's similar to compiler warnings – will the warning be fatal to my particular application? Maybe not.

But it's ultimately a matter of professional discipline. Tolerating compiler warnings and tolerating memory leaks is a bad habit that will ultimately bite me in the rear.

To take things to an extreme, would it ever be acceptable for a surgeon to leave some piece of operating equipment inside a patient?

Although it is possible that a circumstance could arise where the cost/risk of removing that piece of equipment exceeds the cost/risk of leaving it in, and there could be circumstances where it was harmless, if I saw this question posted on SurgeonOverflow.com and saw any answer other than "no," it would seriously undermine my confidence in the medical profession.

If a third party library forced this situation on me, it would lead me to seriously suspect the overall quality of the library in question. It would be as if I test drove a car and found a couple loose washers and nuts in one of the cupholders – it may not be a big deal in itself, but it portrays a lack of commitment to quality, so I would consider alternatives.



Related Topics



Leave a reply



Submit