0

I'm trying to use composer on my local development machine, and it always fails when trying to copy something from the PHAR archive:

[ErrorException]
copy(): open_basedir restriction in effect. File(phar://E:/xampp/php/composer/composer.phar/src/Composer/Autoload/ClassLoader.php) is not within the allowed path(s)

E:\xampp\php\composer is included in the open_basedir directive, reading and writing files in that location works fine, only accessing files in the PHAR archive doesn't work. I've tried adding the following paths:

E:\xampp\php\composer\composer.phar\src\
phar://E:/xampp/php/composer/
phar://E:/xampp/php/composer/composer.phar/src/
phar://E:/xampp/php/composer/composer.phar/src/Composer/Autoload/

but none of it helps, it's still failing with the same error.

Is there a special way to include paths to PHAR archives? Is it possible at all? Should it be neccessary anway? Might this have something to do with this bug: https://bugs.php.net/bug.php?id=64634 ?

My system: Windows 7 x64, XAMPP 1.8.1, Apache 2.4.3, PHP 5.4.7

Update: Tried the latest stable PHP 5.4.14 too, same problem.

4

1 回答 1

1

我设法重现了它,并且使用 stream_copy_to_stream 的解决方法似乎有效,所以我在566313834af3a49cd3f6b41001f7d8549e0b9c96中应用了它,如果你运行 composer self-update 它现在应该可以工作了。

我不太确定 composer 的哪些其他部分可能会受到此影响,但如果您仍有类似问题,请随时在 github 上打开错误报告。

于 2013-04-28T15:06:32.217 回答