Re: Re: install pear on shared hosting with PEAR 1.4 and Net_FTP
| From: | Tim Glen | Date: | Thu, 23 Mar 2006 06:48:16 +0000 |
| Subject: | Re: Re: install pear on shared hosting with PEAR 1.4 and Net_FTP | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-23407@lists.php.net to get a copy of this message | ||
Well I don't know about anyone else, but I use my own local_pear.php script which assumes an existing pear 1.4.x install on the system I'm on. It calls the main pear install but installs all the files in a local directory (that you can set) and keeps it's own registry. Outside of the dependency on an existing pear install (which has never been an issue for me), I've never had a problem with it.
see attached if you're at all interested.
#!/usr/bin/php <?php // thanks to pear installer for parts of this code set_time_limit(0); @ob_end_flush(); ob_implicit_flush(true); ini_set('track_errors', true); ini_set('magic_quotes_runtime', false); error_reporting(E_ALL & ~E_NOTICE); define('WINDOWS', (substr(PHP_OS, 0, 3) == 'WIN')); require_once 'Console/Getopt.php'; $argv = Console_Getopt::readPHPArgv(); array_shift($argv); $options = Console_Getopt::getopt2($argv, '', array('base_install')); $basedir = '/path/to/where/you/want/pear/to/install'; $conf_file = '/path/to/where/you/want/.pearrc'; $set_conf = false; if (!file_exists($conf_file)) { $set_conf = true; // echo "$basedir\n$conf_file\n"; // debug line $cmd = "pear config-create $basedir $conf_file"; passthru($cmd); } $pear = "pear -c $conf_file"; if ($set_conf) { $tmp = $pear . " -d doc_dir=$basedir/doc". " -d doc_dir=$basedir/doc". " -d data_dir=$basedir/data". " -d test_dir=$basedir/test". " -d php_dir=$basedir"; passthru($tmp); } $GLOBALS['cmd'] = $pear; if (isset($options[0][0][0]) && preg_match('/base_install/', $options[0][0][0])) { baseInstall(); exit; } else { if (!empty($argv)) { foreach ($argv as $val) { $GLOBALS['cmd'] .= ' ' . $val; } } passthru($GLOBALS['cmd']); } function baseInstall() { print "====================\n"; print "INSTALLING BASE PEAR\n"; print "====================\n\n"; print "All other options will be ignored for the default pear install.\n"; print "If you need other PEAR options, run it without the 'base_install' option\n\n"; $packages = array('pear', 'db', 'log', 'auth', 'cache_lite', 'html_common', 'html_quickform', 'http_upload', 'net_url', 'http', 'http_header', 'mail', 'net_smtp', 'date'); // or another list of packages if you want (but you need pear) $list = implode(' ', $packages); passthru($GLOBALS['cmd'] . ' install -o ' . $list); } ?>
#!/usr/bin/php <?php // thanks to pear installer for parts of this code set_time_limit(0); @ob_end_flush(); ob_implicit_flush(true); ini_set('track_errors', true); ini_set('magic_quotes_runtime', false); error_reporting(E_ALL & ~E_NOTICE); define('WINDOWS', (substr(PHP_OS, 0, 3) == 'WIN')); require_once 'Console/Getopt.php'; $argv = Console_Getopt::readPHPArgv(); array_shift($argv); $options = Console_Getopt::getopt2($argv, '', array('base_install')); $basedir = '/path/to/where/you/want/pear/to/install'; $conf_file = '/path/to/where/you/want/.pearrc'; $set_conf = false; if (!file_exists($conf_file)) { $set_conf = true; // echo "$basedir\n$conf_file\n"; // debug line $cmd = "pear config-create $basedir $conf_file"; passthru($cmd); } $pear = "pear -c $conf_file"; if ($set_conf) { $tmp = $pear . " -d doc_dir=$basedir/doc". " -d doc_dir=$basedir/doc". " -d data_dir=$basedir/data". " -d test_dir=$basedir/test". " -d php_dir=$basedir"; passthru($tmp); } $GLOBALS['cmd'] = $pear; if (isset($options[0][0][0]) && preg_match('/base_install/', $options[0][0][0])) { baseInstall(); exit; } else { if (!empty($argv)) { foreach ($argv as $val) { $GLOBALS['cmd'] .= ' ' . $val; } } passthru($GLOBALS['cmd']); } function baseInstall() { print "====================\n"; print "INSTALLING BASE PEAR\n"; print "====================\n\n"; print "All other options will be ignored for the default pear install.\n"; print "If you need other PEAR options, run it without the 'base_install' option\n\n"; $packages = array('pear', 'db', 'log', 'auth', 'cache_lite', 'html_common', 'html_quickform', 'http_upload', 'net_url', 'http', 'http_header', 'mail', 'net_smtp', 'date'); // or another list of packages if you want (but you need pear) $list = implode(' ', $packages); passthru($GLOBALS['cmd'] . ' install -o ' . $list); } ?>