Go Back   SitePoint Forums > Forum Index > Program Your Site > PHP
Newsletter FAQ Members List Calendar Mark Forums Read

New to SitePoint Forums? Register here for free!

SitePoint Sponsor
 
Reply
 
Thread Tools Display Modes
Old Aug 17, 2009, 12:50   #1
kgun
SitePoint Addict
 
Join Date: Nov 2005
Location: Moss, Norway.
Posts: 280
Question Installing pear on a shared host.

I posted this

http://www.pear-forum.org/viewtopic.php?p=5171#5171

thread on the unofficial pear forum without any answer. I try here with higher activity.

I know this

http://www.sitepoint.com/article/get...ted-with-pear/

article, but think it is a little outdated.

As explained in the above post. I am on a shared host and for that reason I can not change permissions on the root to 777 that is needed to run this http://pear.php.net/go-pear script on my site.

So is there no other option than to install php locally on your own computer in order to install pear on a shared host.
kgun is offline   Reply With Quote
Old Aug 17, 2009, 13:52   #2
Mittineague
Google search user
silver trophybronze trophy
 
Mittineague's Avatar
 
Join Date: Jul 2005
Location: West Springfield, Massachusetts
Posts: 9,417
If you're on a shared host the chances are good that they already have the core installed and a few packages they use for themselves. Then you could FTP upload aditional packages under your site, and add the path. Not as good as using go-pear, but it will do in a pinch.

Download the PEAR_Info package http://pear.php.net/package/PEAR_Info
Unzip and upload to your site eg. folder named "PEAR" in this example.
Then try uploading and running this file
PHP Code:

<?php

ini_set
(
    
'include_path', ini_get('include_path') . ":" .
        
$_SERVER['DOCUMENT_ROOT'] . "/PEAR/");

    require_once
'Info.php';

    
$info = new PEAR_Info();

    
$info->show();
?>
Mittineague is offline   Reply With Quote
Old Aug 17, 2009, 17:12   #3
kgun
SitePoint Addict
 
Join Date: Nov 2005
Location: Moss, Norway.
Posts: 280
Thank you for answering.

1. That does not function. I get an error:

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(//.pearrc) is not within the allowed path(s): (/home/web/wno134614:/var/tmp:/usr/local/lib/php:/usr/local/share/pear) in /usr/home/web/wno134614/PEAR/Info.php on line 283

....

Last line

PEAR configuration files "//.pearrc", "/usr/local/etc/pear.conf" does not exist

2. According to my hoster and
PHP Code:

<?php
echo ( '<pre>' );
echo
'PHP info = ' . phpinfo() ;
echo (
'</pre>' );
?>
Configuration PHP Core

include_path .:/usr/local/share/pear

PHP Code:

<?php
require_once("Info.php");
echo (
'<pre>' );
echo
'pear info = ' . PEAR_INFO_ALL ;
echo (
'</pre>' );
echo (
'<pre>' );
echo
'pear info = ' . Info::PEAR_Info() ;
echo (
'</pre>' );
?>
I get an error that Info.php is not in that

.:/usr/local/share/pear

path.

3. How is it possible to make such a complicated install and configuration?

Why not make a traditional .zip file that can be downloaded to your folder of choice and uploaded via ftp? For those with slow connections a .tgz file can be made.

This is worse than configuring C++ back in the mid 1990s.
kgun is offline   Reply With Quote
Old Aug 17, 2009, 21:06   #4
Mittineague
Google search user
silver trophybronze trophy
 
Mittineague's Avatar
 
Join Date: Jul 2005
Location: West Springfield, Massachusetts
Posts: 9,417
The "restrictions" error tells you that the host isn't letting scripts "go up into" their PEAR files. You could ask them to change their config to allow you, but it might be easier to just install your own PEAR core.

The "Info.php" error tells you that their PEAR files can't find your Info.php file following their include path(s). Again they would need to change their config.

I'm not sure what would happen if there were copies of the core files, but I think if you're careful to only use yours in include paths you should be OK.

Maybe this will help? http://neacm.fe.up.pt/docs/pear/inst...on.shared.html
Mittineague is offline   Reply With Quote
Old Aug 18, 2009, 02:41   #5
kgun
SitePoint Addict
 
Join Date: Nov 2005
Location: Moss, Norway.
Posts: 280
Quote:
Originally Posted by Mittineague View Post
The "restrictions" error tells you that the host isn't letting scripts "go up into" their PEAR files. You could ask them to change their config to allow you, but it might be easier to just install your own PEAR core.

The "Info.php" error tells you that their PEAR files can't find your Info.php file following their include path(s). Again they would need to change their config.
I came to the same conclusion. By right clicking in remote view in DreamWeaver 2004 Mx with the permission extension installed I can set 777 permission on sub folders but not on the root. The go-pear 1.1.21 installer: http://www.kjellbleivik.com/go-pear.php issue this warning:

"WARNING! No permission to create subdirectories in this prefix dir. Unless you fix this, the default configuration will not work".

Self evident that you can not change permission on the root folder on a shared host. Isn't this as simple as allowing the packages to be installed in sub folders of a main subfolder? This should be an easy fix in the go-pear.php file. That main sub folder could be named PEAR version number or alternatively allow to (delete and) overwrite an old version in a permanent sub folder.

I have asked my hoster to run the installation for me but without an answer so long.

Quote:
Originally Posted by Mittineague View Post
I'm not sure what would happen if there were copies of the core files, but I think if you're careful to only use yours in include paths you should be OK.
Include files were a night mare with C++, so I know everything about that. Sometimes configuring C++ Builder was more difficult than programming. I set include paths in .htaccess, so that is no problem.

Quote:
Originally Posted by Mittineague View Post
Thank you for that on line update of the manual. I have an older version. But isn't that explanation what is already written on the pear site:

http://pear.php.net/manual/en/installation.shared.php

There and in the version of the manual that you refer in the above link it is stated:

Installing a local copy of PEAR through ftp/ftps/sftp

1. Make sure you are running PHP 5.0 or newer on your local computer

That was what I tried to avoid. So it seems that the best solution is to install PHP 5.+ locally on your computer and run the command line installer locally to install the packages and then ftp them to the web server. Not very efficient. Why not modify go-pear.php as indicated above if you have 777 permissions to sub directories and / or alternatively supply a compressed file for the whole package? That solution should be the best and simplest for the general web master that is interested in the whole package. The package.xml file is central for every package. I know that. I know about roles, dependencies, CVS and Quality control. But for the average web master a compressed version of the whole package is good enough and sometimes good enough is best.

I have installed PHP earlier via http://www.apachefriends.org/en/xampp.html for Windows.

"The distribution for Windows 98, NT, 2000, 2003, XP and Vista. This version contains: Apache, MySQL, PHP + PEAR, Perl, mod_php, mod_perl, mod_ssl, OpenSSL, phpMyAdmin, Webalizer, Mercury Mail Transport System for Win32 and NetWare Systems v3.32, Ming, JpGraph, FileZilla FTP Server, mcrypt, eAccelerator, SQLite, and WEB-DAV + mod_auth_mysql."

XAMPP includes PEAR. The whole package or the core? Which version? That can also be good enough.

I uninstalled the package since it took so much place and slowed down my computer. Seems that that is the best solution, since XAMPP was very easy and fast to install.

Thank you for your comment.
kgun is offline   Reply With Quote
Reply

Bookmarks

Tags
pear installation

« Previous Thread | Next Thread »

Thread Tools
Display Modes

 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Sponsored Links
 
Forum Jump


All times are GMT -7. The time now is 13:33.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright 1998-2009, SitePoint Pty Ltd. All Rights Reserved