2 Replies - 8117 Views - Last Post: 26 April 2010 - 09:54 AM Rate Topic: -----

#1 Charlie IronGleet   User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 225
  • Joined: 29-January 09

Installing Pear on Wamp Server with php version 5.2.5

Posted 25 April 2010 - 11:01 AM

I am trying to install pear on my windows 7 system using wamp server and php version 5.2.5

I followed all of the instructions in my book - Beginning PHP 5.3 - to the letter and the install appeared to go fine. I then installed a simple pear package with all the dependencies.

When I run my script I get the following errors:

Warning: require_once(Net/UserAgent/Detect.php) [function.require-once]: failed to open stream: No such file or directory in C:\wamp\www\quotations\test.php on line 10

Fatal error: require_once() [function.require]: Failed opening required 'Net/UserAgent/Detect.php' (include_path='.;C:\php5\pear') in C:\wamp\www\quotations\test.php on line 10

Here is my code:
<html>
	<head>
		<title>Browser Information</title>
		<link rel="stylesheet" type="text/css" href="common.css" />
	</head>
	<body>
		<h1>Browser Information</h1>
		
		<?php 
		require_once("Net/UserAgent/Detect.php");
		
		
		
		
		$detect = new Net_UserAgent_Detect();
		echo "<p>You are running ".$detect->getBrowserString();
		echo ". Your operating system is ".$detect->getOSString(). ".</p>";
		
		?>
	</body>
</html>



My feeling is that I need to do something to the php.ini file but the during the installation it said it was going to set that up too.

Please help! I'm going bonkers over this and i really need to get to work.

Thanks!
Irongleet

Is This A Good Question/Topic? 0
  • +

Replies To: Installing Pear on Wamp Server with php version 5.2.5

#2 Martyr2   User is offline

  • Programming Theoretician
  • member icon

Reputation: 5552
  • View blog
  • Posts: 14,558
  • Joined: 18-April 07

Re: Installing Pear on Wamp Server with php version 5.2.5

Posted 25 April 2010 - 11:55 AM

Typically when you run into those error it is because you don't have your PHP Include Path configured correctly for PEAR. I suggest you check out the following link where it will tell you how to verify if PEAR is working correctly and how to configure your PHP Include path to include PEAR. PHP's include path is the list of directories PHP will look for a particular file when you use an include or require_once call. If the PEAR path is not listed, PHP never looks in the PEAR folders to find the needed files. I am pretty sure this is where your problem lies...

Manual::Checking if PEAR works

Pay special attention to the section titled "Verifying the Include Path". Remember that after you make changes to php.ini to restart your web server (or in the case of windows the web publishing service listed under your Control Panel >> Administrative Tools >> Services section.

Hope this helps you out. :)
Was This Post Helpful? 0
  • +
  • -

#3 Charlie IronGleet   User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 225
  • Joined: 29-January 09

Re: Installing Pear on Wamp Server with php version 5.2.5

Posted 26 April 2010 - 09:54 AM

Thanks -- I'm still having trouble though.

I'll try to give you as much info about my setup as possible here:

wampserver php5.2.5 windows 7 64 bit

the pear packages get installed into this folder C:\wamp\bin\php\php5.2.5\pear
(i.e. the System file is there)

So I changed my include path to that, remembered to remove the semicolon, and restarted my wampserver. Same error.

I checked to make sure the .ini file being used was my php5.2.5 one and it is.

I'm feeling pretty stupid right now :>

Thanks,
Irongleet

AHA!!

I got it!

Now I AM feeling stupider -- I forgot to put PEAR in caps....


Thanks much for your help!
Irongleet
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1