HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Programming/Scripts (http://www.howtoforge.com/forums/forumdisplay.php?f=7)
-   -   Pear Mail in CHROOT Apache (http://www.howtoforge.com/forums/showthread.php?t=42444)

Brian_A 6th January 2010 17:44

Pear Mail in CHROOT Apache
 
Hi

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

/etc/php.ini
include_path = ".:/webroot/usr/share/pear/pear"

apache restart

then run: www.idole.com/infoTest.php

<?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);

require_once 'System.php';
var_dump(class_exists('System'));

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


//set_include_path('');
phpinfo();


?>

produces:

Warning: require_once(System.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/vhosts/idole.com/httpdocs/infoTest.php 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/idole.com/httpdocs/infoTest.php on line 7

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

Brian

falko 7th January 2010 16:22

What is Apache's chroot directory?

Brian_A 7th January 2010 17:30

Hi

Unless I'm mistaken it is:

/var/www/vhosts/chroot/

Brian

Leszek 8th January 2010 00:09

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.

Brian_A 8th January 2010 11:03

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?

Brian

falko 8th January 2010 15:57

This could work.
If the Include_path doesn't work, try
Code:

Include_path = ".:/var/www/vhosts/chroot/usr/share/pear:/usr/share/pear"


All times are GMT +2. The time now is 18:18.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.