PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Problems Installing on a Shared Host

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Installation, Upgrading & Configuration
View previous topic :: View next topic  
Author Message
gr8dane



Joined: 21 Dec 2008
Posts: 8

PostPosted: Sat Feb 05, 2011 3:50 am    Post subject: Problems Installing on a Shared Host Reply with quote

I'm new to PEAR and am trying to install a copy to my site on a shared host (Linux). According to the manual (http://pear.php.net/manual/en/installation.shared.php), in order to install "the traditional way," I should "create a directory that is NOT in your publicly accessible web space ... to be readable and writable by any user," then install to this directory using go-pear.php. Accordingly, I apparently successfully installed PEAR to a directory one level above public_html (/home/my/path/pear).

The manual further states that, "To use the files, you must set the include path in scripts on the website.
Code:
<?php
ini_set('include_path', '~/pear/lib' . PATH_SEPARATOR . ini_get('include_path'));

// From PHP 4.3.0 onward, you can use the following, which especially useful on shared hosts:
set_include_path('~/pear/lib' . PATH_SEPARATOR . get_include_path());
?>

"

I uploaded the following script to test the installation:
Code:
<?php
ini_set('include_path', '/home/my/path/pear' . PATH_SEPARATOR . ini_get('include_path'));
set_include_path('/home/my/path/pear' . PATH_SEPARATOR . get_include_path());

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

I obviously did something wrong somewhere along the line, because when I browse to this file, I get the following:
Code:
Warning: require_once(System.php) [function.require-once]: failed to open stream: No such file or directory in /home/my/path/web/check_pear.php on line 5

Fatal error: require_once() [function.require]: Failed opening required 'System.php' (include_path='/home/my/path/pear:/home/my/path/pear:/usr/local/php/share/pear') in /home/my/path/web/check_pear.php on line 5

Can anyone tell me where I went wrong?
Back to top
View user's profile Send private message
gr8dane



Joined: 21 Dec 2008
Posts: 8

PostPosted: Mon Feb 07, 2011 3:53 am    Post subject: Reply with quote

Well, I finally found enough bits and pieces of information from different sources to enable me to successfully install a copy of PEAR and some packages on my shared host (Linux, PHP 5.2.6), so I thought I'd share my solution with others trying to do the same.

1. Create a password-protected directory in your publicly accessible web space.

2. Download a copy of http://pear.php.net/go-pear and save it as go-pear.php; upload it to the above directory.

3. Create a directory that is NOT in your publicly accessible web space (I named mine "pear"). Set it to be readable and writable by any user (permissions 0777).

4. Browse to your go-pear.php file; follow the installation prompts. When asked where to install PEAR, choose the directory you created in step 3 (for example, /home/my/path/pear).

5. To check if PEAR works, save the following in a php file:
Code:
set_include_path('/home/my/path/pear/PEAR' . PATH_SEPARATOR . get_include_path());

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

Upload the file to your web space and browse to it. Your output should be "bool(true)".

6. To access the package manager, save the following in a php file:
Code:
set_include_path('/home/my/path/pear/PEAR' . PATH_SEPARATOR . get_include_path());

require 'PEAR.php';
require 'pearfrontendweb.php';

Upload the file to your web space and browse to it.

7. Install whatever packages you need.

8. Add the following line to the beginning of every file where you want use a PEAR package:
Code:
set_include_path('/home/my/path/pear/PEAR' . PATH_SEPARATOR . get_include_path());

Hope this is helpful to someone out there.
Back to top
View user's profile Send private message
ndefontenay



Joined: 07 Feb 2011
Posts: 1

PostPosted: Mon Feb 07, 2011 5:14 pm    Post subject: Reply with quote

Hi,

After telling support that it seems my php.ini file didn't seem to be taken into account, the support staff told me that the file has to be renamed php5.ini if you are on php5.

If php5.ini is taken into account, you should be able to get rid of that line your put on every file where pear is used.
Back to top
View user's profile Send private message
gr8dane



Joined: 21 Dec 2008
Posts: 8

PostPosted: Tue Feb 08, 2011 1:02 am    Post subject: Reply with quote

ndefontenay wrote:
If php5.ini is taken into account, you should be able to get rid of that line your put on every file where pear is used.

I think that's only true if you have direct access to that file, which is often not true on a shared host. If you can't set the path to your copy of PEAR in the .ini file, you have to set it in your scripts.
Back to top
View user's profile Send private message
gaia21



Joined: 21 Mar 2011
Posts: 2

PostPosted: Mon Mar 28, 2011 6:57 am    Post subject: Reply with quote

i also have the same problem. I hope somebody can give us an input about this error.
_________________
Provestra Prosolution roulettesniper2
Back to top
View user's profile Send private message
gr8dane



Joined: 21 Dec 2008
Posts: 8

PostPosted: Mon Mar 28, 2011 7:08 am    Post subject: Reply with quote

gaia21 wrote:
I hope somebody can give us an input about this error.

What error are you referring to?
Back to top
View user's profile Send private message
role.ner



Joined: 17 May 2011
Posts: 5

PostPosted: Tue May 24, 2011 11:53 am    Post subject: Reply with quote

I am also using shared web hosting but until now I did not try to install a copy to my site. I will now definitely try to install a copy because I want to test if I also have problems when installing it. I will let you now if it worked for me. Maybe I can help you solving the problem.
Back to top
View user's profile Send private message
adrianTNT



Joined: 12 Jul 2011
Posts: 2

PostPosted: Tue Jul 12, 2011 2:52 pm    Post subject: Reply with quote

I just registered to say that pear structure, requirements, installation instructions and packaging sucks BIG time.

I am getting the same "cannot include" errors like everyone else that I found in the last few hours.

It says that it cannot include the "System.php" file and shows the include path where the file actually is (if testing dir/ls by SSH).

I will just assume that it is a buggy software coded irresponsibility and stop wasting time with it.

// You are sending the forum password as plain text in email, are you kidding me ???
Back to top
View user's profile Send private message
ritter



Joined: 21 Jul 2011
Posts: 2

PostPosted: Thu Jul 21, 2011 10:47 pm    Post subject: Reply with quote

Hi gr8dane, do you have all files on their positions and you double checked pathes? Couse of this error can be several things.
_________________
Provestra, Provacyl and Profollica
Back to top
View user's profile Send private message
adrianTNT



Joined: 12 Jul 2011
Posts: 2

PostPosted: Fri Jul 22, 2011 12:32 am    Post subject: Reply with quote

Maybe it helps, others, in my case it could not load the file because of open_basedir, after I edited open_basedir in httpd.conf it found the pear files.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Installation, Upgrading & Configuration All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement