PEAR Installer on FreeBSD
| From: | Naoki Shima | Date: | Fri, 19 Apr 2002 05:47:20 +0000 |
| Subject: | PEAR Installer on FreeBSD | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-5658@lists.php.net to get a copy of this message | ||
Hi all,
I'd had problem using PEAR Installer on my FreeBSD Box(FreeBSD 4.5-RELEASE
on Intel).
I have found out that getcwd() does not work for CGI version of PHP 4.1.2.
It worked on Apache module version of PHP 4.1.2 though.
I have used $_ENV['PWD'] instead of getcwd() and it worked fine.
Best regards,
Naoki Shima
the patch follows:
Index: Installer.php
===================================================================
RCS file: /repository/php4/pear/PEAR/Installer.php,v
retrieving revision 1.48
diff -c -r1.48 Installer.php
*** Installer.php 13 Apr 2002 06:00:36 -0000 1.48
--- Installer.php 19 Apr 2002 05:50:31 -0000
***************
*** 243,249 ****
if (empty($this->registry)) {
$this->registry = &new
PEAR_Registry($this->config->get('php_dir'));
}
! $oldcwd = getcwd();
$need_download = false;
if (preg_match('#^(http|ftp)://#', $pkgfile)) {
$need_download = true;
--- 243,249 ----
if (empty($this->registry)) {
$this->registry = &new
PEAR_Registry($this->config->get('php_dir'));
}
! $oldcwd = $_ENV['PWD'];
$need_download = false;
if (preg_match('#^(http|ftp)://#', $pkgfile)) {
$need_download = true;
***************
*** 309,315 ****
if (!chdir(dirname($pkgfile))) {
return $this->raiseError('unable to chdir to package
directory');
}
! $pkgfile = getcwd() . DIRECTORY_SEPARATOR . basename($pkgfile);
if (PEAR::isError($tmpdir = $this->mkTempDir())) {
chdir($oldcwd);
--- 309,315 ----
if (!chdir(dirname($pkgfile))) {
return $this->raiseError('unable to chdir to package
directory');
}
! $pkgfile = $_ENV['PWD'] . DIRECTORY_SEPARATOR .
basename($pkgfile);
if (PEAR::isError($tmpdir = $this->mkTempDir())) {
chdir($oldcwd);