Upgrade PHP 5.4 to 5.6 to fix command line error running composer command


#1

Hi
I’m trying to upgrade php to fix this error. I start with the composer command but php version halts it.

C:\Program Files (x86)\DevDesktop\tools>composer create-project drupalcommerce/project-base C:\Users\Ben\Sites\devdesktop\testsite7 --stability dev

C:\Program Files (x86)\DevDesktop\tools>php.exe composer.phar create-project drupalcommerce/project-base C:\Users\Ben\Sites\devdesktop\testsite7 --stability dev
Installing drupalcommerce/project-base (8.x-dev 92a9f6b7e989eb983b507bec2aaa2298ae2db013)

  • Installing drupalcommerce/project-base (8.x-dev 92a9f6b)
    Cloning 92a9f6b7e989eb983b507bec2aaa2298ae2db013
    Failed to download drupalcommerce/project-base from source: Failed to clone https://github.com/drupalcommerce/project-base.git, git was not found, check that it is installed and in your PATH env.

‘git’ is not recognized as an internal or external command,
operable program or batch file.

Now trying to download from dist
  • Installing drupalcommerce/project-base (8.x-dev 92a9f6b)
    Loading from cache

Created project in C:\Users\Ben\Sites\devdesktop\testsite7

DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- drupal/console 1.0.0-rc6 requires php ^5.5.9 || ^7.0 -> your PHP version (5.4.45) does not satisfy that requirement.
- drupal/console 1.0.0-rc5 requires php ^5.5.9 || ^7.0 -> your PHP version (5.4.45) does not satisfy that requirement.
- drupal/console 1.0.0-rc4 requires php ^5.5.9 || ^7.0 -> your PHP version (5.4.45) does not satisfy that requirement.
- drupal/console 1.0.0-rc3 requires php ^5.5.9 || ^7.0 -> your PHP version (5.4.45) does not satisfy that requirement.
- drupal/console 1.0.0-rc2 requires php ^5.5.9 || ^7.0 -> your PHP version (5.4.45) does not satisfy that requirement.
- drupal/console 1.0.0-rc1 requires php ^5.5.9 || ^7.0 -> your PHP version (5.4.45) does not satisfy that requirement.
- drupal/console 1.0.0-beta5 requires php ^5.6 || ^7.0 -> your PHP version (5.4.45) does not satisfy that requirement.
- drupal/console 1.0.0-beta4 requires php ^5.6 || ^7.0 -> your PHP version (5.4.45) does not satisfy that requirement.
- drupal/console 1.0.0-beta3 requires php >=5.5.9 -> your PHP version (5.4.45) does not satisfy that requirement.
- drupal/console 1.0.0-beta2 requires php >=5.5.9 -> your PHP version (5.4.45) does not satisfy that requirement.
- drupal/console 1.0.0-beta1 requires php >=5.5.9 -> your PHP version (5.4.45) does not satisfy that requirement.
- drupal/console 1.0.0-alpha2 requires php >=5.5.9 -> your PHP version (5.4.45) does not satisfy that requirement.
- drupal/console 1.0.0-alpha1 requires php >=5.5.9 -> your PHP version (5.4.45) does not satisfy that requirement.
- Installation request for drupal/console ~1.0 -> satisfiable by drupal/console[1.0.0-alpha1, 1.0.0-alpha2, 1.0.0-beta1, 1.0.0-beta2, 1.0.0-beta3, 1.0.0-beta4, 1.0.0-beta5, 1.0.0-rc1, 1.0.0-rc2, 1.0.0-rc3, 1.0.0-rc4, 1.0.0-rc5, 1.0.0-rc6].

C:\Program Files (x86)\DevDesktop\tools>


#2

What is the issue with updating php?


#3

Hi, thanks for the reply! I installed acquia devdesktop which came bundled with php 5.3, 5.4, 5.5, 5.6 & 7 so I think I have the one i need? I’m guessing I just need to reference the correct one from a configuration file somewhere. I think I read somewhere that the configuration of php at the command line has nothing to do with the php in the development environment yet I can’t find any reference to php anywhere else on the pc apart from the ones above. Is the 5.4 referenced above the one being used? I’ve just started learning php but know nothing about the administration of it I’m just a site builder. If you could help me get this running it would be very much appreciated!
Regards


#4

I’m amazed at how many different “local dev environment” packages are available.

Read the docs, they outline where to change the php version
https://docs.acquia.com/dev-desktop/config#config


#5

Hi Thanks for the link. I tried selecting different default php versions but the error remained. I also found the snippet below in the httpd.conf file and changed it to 5_6 on both lines, this didn’t work either. Am I missing something obvious? thanks

Default fcgi settings

FcgidInitialEnv PHPRC "C:\Program Files (x86)\DevDesktop\php5_4\bin" FcgidWrapper "\"C:/Program Files (x86)/DevDesktop/php5_4/php-cgi.exe\""

#6

Did you restart Apache after changing the settings?


#7

Yes I restart it whenever I make a change but still doesn’t work. I’ve watched people on youtube when installing php placing it here c:\php. My installations are at C:\Program Files (x86)\DevDesktop\php5.x, does that effect anything?


#8

So you have tried this and it failed?


#9

Hi, Yes tried changing those values. I have the default php version is set to 5.6.19.
Not sure if this is relevant but just for info:
PHP is installed here: C:\Program Files (x86)\DevDesktop\php5.x.x (thats 5.3, 5.4, 5.5, 5.6 & 7 all in there own folders)
Composer lives here: C:\Program Files (x86)\DevDesktop\tools - i never installed this, it must have also come bundled with devdesktop

I took the liberty of attaching a copy of my httpd.conf - at the bottom where it says 5_6 on two lines, it originally said 5_4 but I tried changing it.


httpd.conf.pdf (36.5 KB)