-1

I would like to make use of the class

Net_UserAgent_Detect

So I installed Net_UserAgent_Detect via pear

pear install Net_UserAgent_Detect

I found that the respective files have been installed under /usr/share/php. But when I run my php script I still get the error

PHP Fatal error:  Class 'Net_UserAgent_Detect' not found in ...

Do I need to include a file from "Net_UserAgent_Detect" separately ? So should I mention it in php.ini or ?

Thanks !

Prakash Raman
  • 13,319
  • 27
  • 82
  • 132

2 Answers2

1

You can simply use a PSR-0 compatible autoloader when you have your include path setup correctly.

cweiske
  • 30,033
  • 14
  • 133
  • 194
0

Figured it out myself.

After "pear" installing a package, one must find that file and manually include it as well.

Prakash Raman
  • 13,319
  • 27
  • 82
  • 132