Search code examples
phpwindows-7cygwincmdpear

Why won't PEAR work on my PHP Windows installation?


I'm running Wampserver on Windows 7, and I can't seem to get PEAR to work. Well, that's not entirely true-apparently it works on the command line (both cmd.exe and on Cygwin). Here's the sample program I found on PHP.Net that shows you if PEAR is installed:

<?PHP

require_once 'System.php';
var_dump(class_exists('System', false));

?>

On the command line, it returns "bool(true)", and in the browser I get

Warning: require_once(System.php) [function.require-once]: failed to open stream: No such file or directory in C:\wamp\www\foobar.php on line 3

Fatal error: require_once() [function.require]: Failed opening required 'System.php' (include_path='.;C:\php\pear') in C:\wamp\www\foobar.php on line 3

I'm honestly not sure what I'm doing wrong. It seems like both should work, but I'm stumped.

Thanks.


Solution

  • Based on your comments, it looks like your include_path is wrong. Go change your PHP.ini and set your include path to:

    include_path = ".;C:\wamp\bin\php\php5.3.10\pear"