Connect with us


Getting PEAR to work on XAMPP (Apache/MySQL stack on Windows)



php – Getting PEAR to work on XAMPP (Apache/MySQL stack on Windows) – Stack Overflow

Join Stack Overflow to learn, share knowledge, and build your career.

Asked 12 years, 8 months ago

Viewed 176k times

I’m trying to install Laconica, an open-source Microblogging application on my Windows development server using XAMPP as per the instructions provided.

The website cannot find PEAR, and throws the below errors:

Warning: require_once(PEAR.php) [function.require-once]: failed to open stream: No such file or directory in C:xampplitehtdocslaconicalibcommon.php on line 31

Fatal error: require_once() [function.require]: Failed opening required ‘PEAR.php’ (include_path=’.;xampplitephppearPEAR’) in C:xampplitehtdocslaconicalibcommon.php on line 31

  1. PEAR is located in C:xampplitephppear
  2. phpinfo() shows me that the include path is .;xampplitephppear

What am I doing wrong? Why isn’t the PEAR folder being included?

asked Sep 15 ’08 at 13:06

Donnie ThomasDonnie Thomas

3,58988 gold badges4444 silver badges6767 bronze badges


You need to fix your include_path system variable to point to the correct location.

To fix it edit the php.ini file. In that file you will find a line that says, “include_path = …”. (You can find out what the location of php.ini by running phpinfo() on a page.) Fix the part of the line that says, “xampplitephppearPEAR” to read “C:xampplitephppear”. Make sure to leave the semi-colons before and/or after the line in place.

Restart PHP and you should be good to go. To restart PHP in IIS you can restart the application pool assigned to your site or, better yet, restart IIS all together.


27.9k1313 gold badges115115 silver badges180180 bronze badges

answered Sep 15 ’08 at 13:23


26611 silver badge33 bronze badges

Is this answer outdated?



If you are using the portable XAMPP installation and Windows 7, and, like me have the version after they removed the XAMPP shell from the control panel none of the suggested answers here will do you much good as the packages will not install.

The problem is with the config file. I found the correct settings after a lot of trial and error.

Simply pull up a command window in the xamppphp directory and run

pear config-set doc_dir :xamppphpdocsPEAR pear config-set cfg_dir :xamppphpcfg pear config-set data_dir :xamppphpdataPEAR pear config-set test_dir :xamppphptests pear config-set www_dir :xamppphpwww

you will want to replace the ‘:’ with the actual drive letter that your portable drive is running on at the moment. Unfortunately, this needs to be done any time this drive letter changes, but it did get the module I needed installed.

answered Aug 21 ’12 at 17:54

Reid JohnsonReid Johnson

1,3141414 silver badges1919 bronze badges

Is this answer outdated?


I tried all of the other answers first but none of them seemed to work so I set the pear path statically in the pear config file


find this code:


and just replace it with this:

$PEAR_INSTALL_DIR = “C:\xampp\php\pear”;

I restarted apache and used the command:

pear config-all

make sure the all of the paths no longer start with C:phppear

answered Jul 3 ’15 at 10:00

Is this answer outdated?


AS per point 1, your PEAR path is c:xampplitephppear

However, your path is pointing to xampplitephppearPEAR

Putting the two one above the other you can clearly see one is too long:



Your include path is set to go one PEAR too deep into the pear tree. The PEAR subfolder of the pear folder includes the PEAR component. You need to adjust your include path up one level.

(you don’t need the c: by the way, your path is fine as is, just too deep)

answered Sep 15 ’08 at 13:16


1,08911 gold badge1212 silver badges2626 bronze badges

Is this answer outdated?


On Windows use the Xampp shell (there is a ‘Shell’ button in your XAMPP control panel)


cd phppear

to go to ‘C:xamppphppear’

then type


answered Feb 1 ’17 at 8:35


4,35733 gold badges3333 silver badges4747 bronze badges

Is this answer outdated?


I fixed

avast deletes your server.php in your directory so disable the antivirus

check the (server.php) file on your laravel folder


*/ $uri = urldecode( parse_url($_SERVER[‘REQUEST_URI’], PHP_URL_PATH) ); // This file allows us to emulate Apache’s “mod_rewrite” functionality from the // built-in PHP web server. This provides a convenient way to test a Laravel // application without having installed a “real” web server software here. if ($uri !== ‘/’ && file_exists(__DIR__.’/public’.$uri)) { return false; } require_once __DIR__.’/public/index.php’;

answered Mar 18 ’19 at 6:04

Is this answer outdated?


Try adding the drive letter:


also verify that PEAR.php is actually there, it might be in php instead:


answered Sep 15 ’08 at 13:15


7,5341212 gold badges4949 silver badges6262 bronze badges

Is this answer outdated?


Another gotcha for this kind of problem: avoid running pear within a Unix shell (e.g., Git Bash or Cygwin) on a Windows machine. I had the same problem and the path fix suggested above didn’t help. Switched over to a Windows shell, and the pear command works as expected.

answered Sep 13 ’13 at 14:18

Is this answer outdated?


Highly active question. Earn 10 reputation in order to answer this question. The reputation requirement helps protect this question from spam and non-answer activity.


{};’)}catch(a){return!0}}function o(){return’undefined’!=typeof googletag&&!!googletag.apiReady}function p(){o()||(googletag={cmd:l(B)})}function q(){var a=document.createElement(‘div’);a.className=’adsbox’,’clc-abd’,’absolute’,’none’,a.innerHTML=’ ‘,document.body.appendChild(a)}function r(){return Object.keys(F.ids).filter(function(a){return’clc-cpa’!=a})}function s(a){var b=a.split(‘_’)[0],c=F.ids[b],d=F.slots[c];’function’==typeof d&&(d=d(b));return{path:’/’+C+’/’+E+’/’+c+’/’+D,sizes:d,zone:c}}function t(a){try{Array.isArray(clc.dfp.slotsRenderedEvents)||(clc.dfp.slotsRenderedEvents=[]),clc.dfp.slotsRenderedEvents.push(a);var b=a.slot.getSlotElementId(),c=[];b||c.push(‘id=0’);var d=document.getElementById(b);if(!b||d?d.hasAttribute(‘data-clc-stalled’)&&c.push(‘st=1’):c.push(‘el=0’),0!==c.length)return void G(c.join(‘&’));var e=s(b),;if(clc.collapse&&clc.collapse[f]&&a.isEmpty)return h(d),void d.setAttribute(‘data-clc-ready’,’true’);if(-1!==y.dh.indexOf(a.lineItemId))h(d);else if(a.lineItemId){d.setAttribute(‘data-clc-prefilled’,’true’);var j=d.parentElement;if(j.classList.contains(‘js-zone-container’)){g(j);var k=j.querySelectorAll(‘.js-report-ad-button-container’),l=k[0];switch(’24px’,b){case’dfp-tlb’:case’dfp-tag’:{j.classList.add(‘mb8′);break}case’dfp-mlb’:case’dfp-smlb’:case’dfp-bmlb’:{j.classList.add(‘my8′);break}case’dfp-isb’:{j.classList.add(‘mt24′);break}case’dfp-m-aq’:{j.classList.add(‘my12’),j.classList.add(‘mx-auto’);break}default:}i(j),i(d)}else i(d);if(‘dfp-msb’==b){var m=document.getElementById(‘hireme’);h(m)}}d.setAttribute(‘data-clc-ready’,’true’)}catch(a){var n=document.querySelector(‘#dfp-tsb, #dfp-isb, #clc-tsb’);n&&n.setAttribute(‘data-clc-ready’,’true’),G(‘e=1’)}}function u(a,b){‘dfp-isb’===a&&b.setTargeting(‘Sidebar’,[‘Inline’]),’dfp-tsb’===a&&b.setTargeting(‘Sidebar’,[‘Right’]);var c=s(a),d=c.path,e=c.sizes,,g=googletag.defineSlot(d,e,a);g.addService(b),!1;var h=a.split(‘_’);if(‘clc-cpa’==h[0]&&h[1]){var i=h[1];g.setTargeting(‘talent-company-id’,i)}}function v(b){var c=a.dfp&&a.dfp.targeting||{};’SystemDefault’===c.ProductVariant&&(window.matchMedia&&window.matchMedia(‘(prefers-color-scheme: dark)’).matches?c.ProductVariant=’Dark’:c.ProductVariant=’Light’),Object.keys(c).forEach(function(a){b.setTargeting(a,c[a])})}function w(a){var;return{eligible:g.filter(f).filter(d),ineligible:g.filter(c)}}function x(b){void 0===b&&(b=r());var c=[‘dfp-mlb’,’dfp-smlb’];if(!o())return p(),void googletag.cmd.push(function(){return x(b)});var d=w(b),e=d.eligible,f=d.ineligible;if(e.forEach(function(a){g(a)}),f.forEach(h),0!==e.length){y.abd&&q();var i=googletag.pubads().getSlots(),j=i.filter(function(a){return 0c.indexOf(}),m=e.filter(function(a){return!!y.ll&&0<=c.indexOf(});l.forEach(function(a){u(,k),a.setAttribute('data-dfp-zone','true')}),googletag.enableServices(),l.forEach(function(a){googletag.display(}),y.ll&&(k.enableLazyLoad({fetchMarginPercent:0,renderMarginPercent:0}),m.forEach(function(a){u(,k),a.setAttribute('data-clc-prefilled','true')}),m.forEach(function(a){googletag.display(}))}}var y=function(a){for(var b=[],c=1;c Stack Overflow works best with JavaScript enabled

Your privacy

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.


Copyright © 2021