8 Replies - 819 Views - Last Post: 25 November 2016 - 03:02 AM

#1 NickD  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 20-December 12

Problem installing Composer on Windows

Posted 24 November 2016 - 05:33 AM

Windows 7, WAMP, PHP5.4.3
I have been trying to install Composer for 2 days and it's driving me crazy - when using the Widows installer I get error
'Unable to create Composer home directory "C:/Users/NickAndGill/Application Data/Composer": mkdir(): No such file or directory'

I am a newbie on Command Line but have got the composersetup.php in the php directory but when I try and install it I get the same kind of error:

C:\wamp\bin\php\php5.4.3>php composer-setup.php
PHP Warning:  file_put_contents(C:/Users/NickAndGill/Application Data/Composer/k
eys.dev.pub): failed to open stream: No such file or directory in C:\wamp\bin\ph
p\php5.4.3\composer-setup.php on line 476
PHP Stack trace:
PHP   1. {main}() C:\wamp\bin\php\php5.4.3\composer-setup.php:0
PHP   2. process() C:\wamp\bin\php\php5.4.3\composer-setup.php:13
PHP   3. installComposer() C:\wamp\bin\php\php5.4.3\composer-setup.php:55
PHP   4. file_put_contents() C:\wamp\bin\php\php5.4.3\composer-setup.php:476


and then reams of warnings and errors because of the same kind of thing.

I haven't got (or I can't see) an Application Data directory, I have an AppData directory.

I would be very grateful; for any pointers on this.
Cheers,
Nick

Is This A Good Question/Topic? 0
  • +

Replies To: Problem installing Composer on Windows

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 4138
  • View blog
  • Posts: 13,074
  • Joined: 08-June 10

Re: Problem installing Composer on Windows

Posted 24 November 2016 - 05:46 AM

you may want to use https://github.com/c...r/windows-setup then.
Was This Post Helpful? 0
  • +
  • -

#3 NickD  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 20-December 12

Re: Problem installing Composer on Windows

Posted 24 November 2016 - 06:46 AM

Hi Dormilich,

Thanks for that but I get exactly the same error as when using the Windows Installer from the Composer home site(:
Was This Post Helpful? 0
  • +
  • -

#4 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 4138
  • View blog
  • Posts: 13,074
  • Joined: 08-June 10

Re: Problem installing Composer on Windows

Posted 24 November 2016 - 06:56 AM

then you are not using the installer (because your first error is from a PHP script and the installer is an executable).
Was This Post Helpful? 0
  • +
  • -

#5 NickD  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 20-December 12

Re: Problem installing Composer on Windows

Posted 24 November 2016 - 07:29 AM

I used the Windows installer from the Composer Home site initially and got installation error :'Unable to create Composer home directory "C:/Users/NickAndGill/Application Data/Composer": mkdir(): No such file or directory'(see original post). Then I( tyried the Command Line Method.

When using the installer from the Github link you provided I got exactly the same error as the initial Windows Installer attempt.
Was This Post Helpful? 0
  • +
  • -

#6 astonecipher  Icon User is offline

  • Too busy for this
  • member icon

Reputation: 2343
  • View blog
  • Posts: 9,398
  • Joined: 03-December 12

Re: Problem installing Composer on Windows

Posted 24 November 2016 - 08:00 AM

Seems to me like the Directory is wrong. An Apache stack should be in htdocs or www directory, not Application Data.
Was This Post Helpful? 0
  • +
  • -

#7 NickD  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 20-December 12

Re: Problem installing Composer on Windows

Posted 24 November 2016 - 08:03 AM

From the Set Up log created to follow the installation of the Github installer:
2016-11-24 13:51:24.539 Log opened. (Time zone: UTC+00:00)
2016-11-24 13:51:24.539 Setup version: Inno Setup version 5.5.9 (u)
2016-11-24 13:51:24.539 Original Setup EXE: C:\Users\NickAndGill\Desktop\Composer-Setup.4.5.0.exe
2016-11-24 13:51:24.539 Setup command line: /SL5="$1D0370,290864,121344,C:\Users\NickAndGill\Desktop\Composer-Setup.4.5.0.exe" /SPAWNWND=$330366 /NOTIFYWND=$1E036A
2016-11-24 13:51:24.539 Windows version: 6.1.7601 SP1 (NT platform: Yes)
2016-11-24 13:51:24.539 64-bit Windows: Yes
2016-11-24 13:51:24.539 Processor architecture: x64
2016-11-24 13:51:24.539 User privileges: Administrative
2016-11-24 13:51:24.539 64-bit install mode: No
2016-11-24 13:51:24.549 Created temporary directory: C:\Users\NICKAN~1\AppData\Local\Temp\is-FM3MO.tmp
2016-11-24 13:51:24.549 Extracting temporary file: C:\Users\NICKAN~1\AppData\Local\Temp\is-FM3MO.tmp\check.php
2016-11-24 13:51:24.549 Extracting temporary file: C:\Users\NICKAN~1\AppData\Local\Temp\is-FM3MO.tmp\installer.php
2016-11-24 13:51:24.569 Extracting temporary file: C:\Users\NICKAN~1\AppData\Local\Temp\is-FM3MO.tmp\composer
2016-11-24 13:51:24.579 $ Getting path info from registry
2016-11-24 13:53:32.149 $ Checking selected php: C:\wamp\bin\php\php5.4.3\php.exe
2016-11-24 13:53:32.149 $ -- Execute File --
2016-11-24 13:53:32.149 $ Running "C:\wamp\bin\php\php5.4.3\php.exe" -v
2016-11-24 13:53:32.368 $ Success: exit code [0]
2016-11-24 13:53:32.368 $ -- Execute File --
2016-11-24 13:53:32.368 $ Running "C:\Windows\system32\cmd.exe" /c "C:\wamp\bin\php\php5.4.3\php.exe check.php > C:\Users\NICKAN~1\AppData\Local\Temp\is-FM3MO.tmp\stdout.txt 2> C:\Users\NICKAN~1\AppData\Local\Temp\is-FM3MO.tmp\stderr.txt"
2016-11-24 13:53:32.446 $ Success: exit code [0]
2016-11-24 13:53:32.446 $ Details: version 5.4.3, tls = 1, ini = C:\wamp\bin\php\php5.4.3\php.ini
2016-11-24 13:53:32.446 $ Checking php path
2016-11-24 13:53:32.446 $ Registering: Add to System path: C:\wamp\bin\php\php5.4.3
2016-11-24 13:53:32.446 $ Checking composer bin path
2016-11-24 13:53:32.446 $ Registering: Add to System path: C:\ProgramData\ComposerSetup\bin
2016-11-24 13:53:32.446 $ Checking PathExt values for .BAT
2016-11-24 13:53:32.446 $ Registering: Add to User path: C:\Users\NickAndGill\Application Data\Composer\vendor\bin
2016-11-24 13:53:48.264 $ Running Composer installer script
2016-11-24 13:53:48.264 $ -- Execute File --
2016-11-24 13:53:48.264 $ Running "C:\Windows\system32\cmd.exe" /c "C:\wamp\bin\php\php5.4.3\php.exe installer.php -- --no-ansi --quiet > C:\Users\NICKAN~1\AppData\Local\Temp\is-FM3MO.tmp\stdout.txt 2> C:\Users\NICKAN~1\AppData\Local\Temp\is-FM3MO.tmp\stderr.txt"
2016-11-24 13:53:48.389 $ Success: exit code [1]
2016-11-24 13:53:48.389 $ Error: [ERR_INSTALL_ERRORS]
Unable to create Composer home directory "C:/Users/NickAndGill/Application Data/Composer": mkdir(): No such file or directory

2016-11-24 13:54:03.973 Deinitializing Setup.
2016-11-24 13:54:03.989 Log closed.
Was This Post Helpful? 0
  • +
  • -

#8 NickD  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 20-December 12

Re: Problem installing Composer on Windows

Posted 24 November 2016 - 08:24 AM

This is the part of the PHP script it's dropping off at:

function installComposer($version, $installDir, $filename, $quiet, $disableTls, $cafile, $channel)
{
    $installPath = (is_dir($installDir) ? rtrim($installDir, '/').'/' : '') . $filename;
    $installDir  = realpath($installDir) ? realpath($installDir) : getcwd();
    $file        = $installDir.DIRECTORY_SEPARATOR.$filename;

    if (is_readable($file)) {
        @unlink($file);
    }

    $home = getHomeDir();

    if (!is_dir($home)) {
        @mkdir($home, 0777, true);
    }

    file_put_contents($home.'/keys.dev.pub', <<<DEVPUBKEY
-----BEGIN PUBLIC KEY-----
Then a load of bumf and -----END PUBLIC KEY-----
DEVPUBKEY
);
    file_put_contents($home.'/keys.tags.pub', <<<TAGSPUBKEY
-----BEGIN PUBLIC KEY-----

etc


Was This Post Helpful? 0
  • +
  • -

#9 NickD  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 20-December 12

Re: Problem installing Composer on Windows

Posted 25 November 2016 - 03:02 AM

Sorted it by altering the php install file:

$home = getHomeDir();
   $home = 'C:/Users/NickAndGill/AppData/Composer';]


getHomeDir()was giving a path that didn't exist.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1