I am in in the process of adding mediawiki to a sever that already has Apache and php installed.

Dani AI

Generated

Short answer: go-pear.phar is the PEAR installer packaged as a PHAR (PHP Archive). It is a self-contained installer you run with the PHP CLI to install the PEAR framework, the pear command-line tool, and the PEAR package directory. was pointing you in the right direction by referencing PEAR; (since you’re installing MediaWiki) you only need this if MediaWiki or an extension requires a PEAR package — core MediaWiki usually does not.

How to run and check things (typical workflow):

php -v
php -m | grep -i phar

sudo php go-pear.phar

After the installer finishes, verify with:

pear version
pear config-show
pear list

Common pitfalls and fixes:

  • CLI vs Apache PHP: the PHP used on the command line often uses a different php.ini than Apache. Check the Apache configuration with a phpinfo() page and compare to php --ini or php -i. If web scripts can’t find PEAR packages, the include_path in the php.ini used by Apache needs the PEAR path.

  • To add PEAR to web PHP without editing the system php.ini, either add the PEAR path in MediaWiki’s LocalSettings.php:

    set_include_path(get_include_path() . PATH_SEPARATOR . '/path/to/pear');

    or (if using mod_php) add to .htaccess:

    php_value include_path ".:/path/to/pear"

    (Note: php_value won’t work under FastCGI/CGI.)

  • Backup php.ini before editing, and run the installer as a user with appropriate permissions (use a local install if you don’t have root access).

Modern note: many PHP projects now use Composer for dependency management. If installing libraries for MediaWiki, check whether Composer is the recommended path first.

Recommended Answers

All 2 Replies

You got this solved? So what DOES the go-pear.phar file do? :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.