Add PEAR Package


What issue or error are you experiencing?

I have a plugin that requires the PEAR Package “HTTP/HTTP_Request2”. How do I go about installing PEAR Packages for use in a local site?

Warning : require_once(HTTP/Request2.php): Failed to open stream: No such file or directory in /Users/steve/LocalSites/mydev/app/public/wp-content/plugins/dcpMyPlugin/includes/dcpMyPlugin.mimeoClasses.php on line 16

Fatal error : Uncaught Error: Failed opening required ‘HTTP/Request2.php’

System Details

  • **Local Version: Version 8.2.1+6583

  • **Operating System (OS) and OS version: MacOS Ventura 13.5.

Thank you

Hi @jdonovan

You might be able to get things going with this command:

pear install http_request2

I also found this documentation from Pear with installation checks you might go through if you’re still having trouble:

Thank you.

The issue is getting PEAR installed on the ‘local site’, using the Site Shell, so I can then install the Package. I don’t see a way to do so.

Thanks for any insight in how to get this accomplished.

If you use Open Site Shell within the Local app under your site name does that work? Or do you need more specific commands?

Have you tried checking Pear support channels or their documentation here?

I resolved the issue.

First - I placed a copy of my PEAR directory, including the Packages I need (copied from my production server) in the localwp site at ~sitedir/conf/php/pear, then modified the ~sitedir/conf/php/php.ini.hbs file to add the pear directory to the include_path: .:/usr/share/php:/Users/jdonovan/LocalSites/~sitedir/conf/php/pear

This provided access to the PEAR Packages I need and resolved the problem.

1 Like

Glad to hear it and thank you for sharing the solution for others here @jdonovan!

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.