OpenWrt Forum Archive

Topic: PEAR not working in PHP5/apache for ampache

The content of this topic has been archived on 20 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi all

I wan't to run Ampache (http://ampache.org) on my FSG-3 but get some PHP-PEAR errors
I've made the wiki for the FSG-3 http://wiki.openwrt.org/toh/freecom/fsg-3 and it is currently running: ATTITUDE ADJUSTMENT (bleeding edge, r30755)

I've installed Apache, MySQL and PHP successfully.
moved the Ampache Files to /usr/share/htdocs/ampache and run the installation of ampache sucessfully.

http://my-router-ip:81/ampache/test.php <-- shows all green and working


But when i Start ampache after the installation, with http://my-router-ip:81/ampache/ i get an error

Fatal error: Class 'PEAR' not found in /usr/share/htdocs/ampache/modules/pearxmlrpc/rpc.php on line 42

rpc.php line 40-43 wrote:

if (!function_exists('xml_parser_create')) {
    include_once 'PEAR.php';
    PEAR::loadExtension('xml');
}

I have installed also the pear packages

root@OpenWrt:/# opkg list-installed | grep pear
php-pear - 1.5.4-1
php-pear-db - 1.7.11-1
php-pear-xmlrpc - 1.5.1-1

I've searched the net for some instructions to get the pear working,
http://pear.php.net/manual/en/installation.checking.php <-- looks like my problem

and it looks there are some missing/wrong lines in the /etc/php.ini

; Paths and Directories
; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"

but i don't know how to find out the include path of the pear install.
to modify the php.ini to get ampache properly working
can't find the System.php file on my System to find the PEAR's php_dir.

so I need a little bit help on this topic

Where is the PEAR's php_dir
and where i have to change the php_dir include_path

include_path string

Specifies a list of directories where the require(), include(), fopen(), file(), readfile() and file_get_contents() functions look for files. The format is like the system's PATH environment variable: a list of directories separated with a colon in Unix or semicolon in Windows.

http://www.php.net/manual/en/ini.core.p … clude-path

Where is the php_dir when using apache with php-module like in openwrt.


http://www.cyberciti.biz/faq/how-do-i-s … -ini-file/

(Last edited by cave on 14 Mar 2012, 10:19)

AMPACHE is working

i've set the include path
include_path = ".:/usr/lib/php/:/usr/lib/php/PEAR/" 

after that there was no error, but also no ampache...

I asked the dev-team from ampache on irc and they said i should use a nightly build.

wget http://gitorious.org/ampache/ampache/ar … all/master


now it is running,
only some problems with charsets utf-8 ampache-php-mysql-apache and my music files appear.


but pear problem is solved and ampache runs

The discussion might have continued from here.