Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Install Fails on Windows with error "not within the allowed path" #2636

@sarcanon

Description

@sarcanon

I am unable to install composer on Windows using either the installer or manual installation. This is on Windows 7 (64). I'm trying to install in my development stack (WT-NMP).

With the automatic installer, the error is:

The PHP file you specified did not execute correctly: F:\WT-NMP\bin\php-5.4.24\php.exe

Running it from the command line might highlight the problem.
Use the -v switch to show the PHP version - it must be at least 5.3.2
Internal Error [ERR_STATUS], exit code 255

When I attempt to install manually, this is what happens:

F:\WT-NMP\bin\php-5.4.24>php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"
#!/usr/bin/env php
All settings correct for using Composer
PHP Warning:  realpath(): open_basedir restriction in effect. File(F:\WT-NMP\bin\php-5.4.24) is not within the allowed path(s): (c:/work/wt-nmp) in Command line code(1) : eval()'d code on line 312

Warning: realpath(): open_basedir restriction in effect. File(F:\WT-NMP\bin\php-5.4.24) is not within the allowed path(s): (c:/work/wt-nmp) in Command line code(1) : eval()'d code on line 312
PHP Warning:  is_readable(): open_basedir restriction in effect. File(F:\WT-NMP\bin\php-5.4.24\composer.phar) is not within the allowed path(s): (c:/work/wt-nmp)
in Command line code(1) : eval()'d code on line 315

Warning: is_readable(): open_basedir restriction in effect. File(F:\WT-NMP\bin\php-5.4.24\composer.phar) is not within the allowed path(s): (c:/work/wt-nmp) in Command line code(1) : eval()'d code on line 315
Downloading...
Could not create file F:\WT-NMP\bin\php-5.4.24\composer.phar: fopen(): open_basedir restriction in effect. File(F:\WT-NMP\bin\php-5.4.24\composer.phar) is not within the allowed path(s): (c:/work/wt-nmp)
fopen(F:\WT-NMP\bin\php-5.4.24\composer.phar): failed to open stream: Operation not permitted
Download failed: fopen(): open_basedir restriction in effect. File(F:\WT-NMP\bin\php-5.4.24\composer.phar) is not within the allowed path(s): (c:/work/wt-nmp)
fopen(F:\WT-NMP\bin\php-5.4.24\composer.phar): failed to open stream: Operation not permitted
fwrite() expects parameter 1 to be resource, boolean given
Downloading...
Could not create file F:\WT-NMP\bin\php-5.4.24\composer.phar: fopen(): open_basedir restriction in effect. File(F:\WT-NMP\bin\php-5.4.24\composer.phar) is not within the allowed path(s): (c:/work/wt-nmp)
fopen(F:\WT-NMP\bin\php-5.4.24\composer.phar): failed to open stream: Operation not permitted
Download failed: fopen(): open_basedir restriction in effect. File(F:\WT-NMP\bin\php-5.4.24\composer.phar) is not within the allowed path(s): (c:/work/wt-nmp)
fopen(F:\WT-NMP\bin\php-5.4.24\composer.phar): failed to open stream: Operation not permitted
fwrite() expects parameter 1 to be resource, boolean given
Downloading...
Could not create file F:\WT-NMP\bin\php-5.4.24\composer.phar: fopen(): open_basedir restriction in effect. File(F:\WT-NMP\bin\php-5.4.24\composer.phar) is not within the allowed path(s): (c:/work/wt-nmp)
fopen(F:\WT-NMP\bin\php-5.4.24\composer.phar): failed to open stream: Operation not permitted
Download failed: fopen(): open_basedir restriction in effect. File(F:\WT-NMP\bin\php-5.4.24\composer.phar) is not within the allowed path(s): (c:/work/wt-nmp)
fopen(F:\WT-NMP\bin\php-5.4.24\composer.phar): failed to open stream: Operation not permitted
fwrite() expects parameter 1 to be resource, boolean given
The download failed repeatedly, aborting.

Might someone be able to tell me what I am doing wrong?

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions