Pear Mail in CHROOT Apache

Discussion in 'Programming/Scripts' started by Brian_A, Jan 6, 2010.

  1. Brian_A

    Brian_A New Member


    I need to get apache which is chrooted to acces pear. So I tried first a test like this, but it fails and cannot see why.

    mkdir -p /webroot/usr/share/pear
    cd /webroot/usr/share/pear
    cp -avr /usr/share/pear .

    chown apache:apache /webroot/usr/share/pear -R

    include_path = ".:/webroot/usr/share/pear/pear"

    apache restart

    then run:

    ini_set('error_reporting', E_ALL);
    ini_set('display_errors', 1);

    require_once 'System.php';

    * To change this template, choose Tools | Templates
    * and open the template in the editor.




    Warning: require_once(System.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/vhosts/ on line 7

    Fatal error: require_once() [function.require]: Failed opening required 'System.php' (include_path='.:/webroot/usr/share/pear/pear') in /var/www/vhosts/ on line 7

    So I guess there is something I don't see here. Can anyone help me fix this please

  2. falko

    falko Super Moderator ISPConfig Developer

    What is Apache's chroot directory?
  3. Brian_A

    Brian_A New Member


    Unless I'm mistaken it is:


  4. Leszek

    Leszek Member

    You could copy Pear files to Your docroot and refer to them in Your scripts.
    It should work as long as the paths will be corect.
  5. Brian_A

    Brian_A New Member

    Thank you for the point in the right direction. I'm a little nervous about this on two counts. 1. I'm new to Linux and there are many things I'm still having to learn. 2. This is a production server, which I did not set up.

    I think I should do the following:

    cd /var/www/vhosts/chroot/usr/share

    cp –avr /usr/share/pear .

    chown apache:apache /var/www/vhosts/chroot/share/pear –R

    vi /etc/php.ini
    Include_path = ”.:/var/www/vhosts/chroot/usr/share/pear”

    Does this seem correct?

  6. falko

    falko Super Moderator ISPConfig Developer

    This could work.
    If the Include_path doesn't work, try
    Include_path = ".:/var/www/vhosts/chroot/usr/share/pear:/usr/share/pear"

Share This Page