Installing php-pear

Support/Development for PHP
raaqi
Forum User
Forum User
Posts: 7
Joined: Sun Jun 10, 2007 9:59 pm

Installing php-pear

Unread post by raaqi »

I did yum install php-pear. It's now in /usr/share/pear but it's not active. Do i need to reconfigure PHP? I don't have the original install files so i might have to re-download & reconfigure. Is this right?

configure command:

'./configure' '--build=i686-redhat-linux-gnu' '--host=i686-redhat-linux-gnu' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-kerberos' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--with-mime-magic=/usr/share/file/magic' '--without-sqlite' '--with-libxml-dir=/usr' '--with-xml' '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd' '--without-odbc' '--disable-dom' '--disable-dba' '--without-unixODBC' '--disable-pdo' '--disable-xmlreader' '--disable-xmlwriter'
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Unread post by breun »

What do you mean when you say "it's not active"? That configure line is not very relevant here, as that is the configure line that was used to build the core php package, php-pear is a separate package.
Lemonbit Internet Dedicated Server Management
raaqi
Forum User
Forum User
Posts: 7
Joined: Sun Jun 10, 2007 9:59 pm

Unread post by raaqi »

Well, the test script i use is just coming up blank. I have php errors on, but i see nothing. just a blank page.

very strange.
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Unread post by breun »

Have you checked your logs? By default errors are not logged to the browser (display_errors = Off), but just to the domain's error_log.
Lemonbit Internet Dedicated Server Management
raaqi
Forum User
Forum User
Posts: 7
Joined: Sun Jun 10, 2007 9:59 pm

Unread post by raaqi »

Thanks, I think it's another issue actually. I ran a test via SSH. This is the result.

# php -q test.php

PHP Warning: require_once(): SAFE MODE Restriction in effect. The script whose uid is 10038 is not allowed to access /usr/share/pear/PEAR.php owned by uid 0 in /var/www/vhosts/...... on line 34


Safe_Mode is off (confirmed with phpinfo()). And i added base_dir string for pear... gah!
raaqi
Forum User
Forum User
Posts: 7
Joined: Sun Jun 10, 2007 9:59 pm

Unread post by raaqi »

Who should own PEAR? It's currently root:root. Should it be apache?
raaqi
Forum User
Forum User
Posts: 7
Joined: Sun Jun 10, 2007 9:59 pm

Unread post by raaqi »

i got this working for the client who needed it by chown'ing the pear dir to that user & group.
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Unread post by breun »

When you run php from the command line it uses the settings from /etc/php.ini, so if you disabled safe_mode for the domain that doesn't mean you get the same environment when you run your script from the command line.

I have one domain here that uses PEAR files from /usr/share/pear and has /usr/share/pear added to its include_path (not necessary, but that makes for easier including) and open_basedir path in its vhost.conf, like this:

Code: Select all

<Directory /var/www/vhosts/example.com/httpdocs>
php_value include_path .:/usr/share/pear
php_admin_value open_basedir /var/www/vhosts/example.com/httpdocs:/tmp:/usr/share/pear
</Directory>
What does your config and test.php look like?
Lemonbit Internet Dedicated Server Management
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Unread post by breun »

raaqi wrote:i got this working for the client who needed it by chown'ing the pear dir to that user & group.
Then probably other domains won't be able to use PEAR. You might as well then just download the PEAR files you need and put them in the domain's documentroot and not use the php-pear package at all.
Lemonbit Internet Dedicated Server Management
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Unread post by scott »

Is this using PHP 5.2.5? And if so are you using php_admin_value to modify the include path anywhere on any domain?
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Unread post by breun »

You can check the above by executing this:

Code: Select all

# find /var/www/vhosts -name vhost\*.conf -print0 | xargs -0 grep php_admin_value.*include_path
However, I still seem to have include_path problems under PHP 5.2.5 even though the above code returns nothing.
Lemonbit Internet Dedicated Server Management
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Unread post by scott »

Ive had to duke it out with some other apps, like tikiwiki and the include path set in php.ini. So far Ive found it easier to disable that, and then set it per domain (when I need to) with php_value.
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Unread post by breun »

To bad Plesk's php*-configurator package sets the include_path in /etc/php.ini to ".:", so you'll have to disable include_path every time Plesk does that.
Lemonbit Internet Dedicated Server Management
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Unread post by scott »

Im debating making my own trigger to counter that :P
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Unread post by breun »

But if Plesk setting the include_path causes problems with PHP 5.2.5, shouldn't we just file a bug report with SWsoft about the issue?
Lemonbit Internet Dedicated Server Management
Post Reply