Composer conflict with php version

hi all

earlier i was using xampp with php 5.3

at the same time i installed composer

but now i am using wamp with php 5.4

now when i tried to run composer on some scripts

it took php 5.3 as current version and showed me error that you current ver 5.3 is not supported for this script to run.

now how can i make or configure composer to take php 5.4 of wamp as current version instead of xampp 5.3 ??

or do it have install the composer again ??

vineet

From the same command line from which you run composer, run

php --version 

and verify you get the expected result.

when i write
e:\wamp\www\gapi\google-api-client>composer install

then it says your php version is 5.3 and api client requires 5.4

But when i write
e:\wamp\www\gapi\google-api-client>php --version
then it showed latest version 5.4

now what should i do next ??

vineet

EDIT :
When i rechecked why its showing 5.4 version, then i came to know its picking up version from xampp folder.

How do i make composer pick version from wamp instead of xampp ??

echo $PATH

You will probably see that xampp is being searched before wampp. Adjust as necessary.

Better yet, do you really need xampp anymore? If not, remove it. Trying to have two different versions of php on one machine can be challenging to manage.

If you really do need multiple versions then consider something like vagrant or docker.

if this is to be written inside php file then i created it and pasted this code in it.

but it echoed nothing.
blank page seen.

vineet

nope, that’s a CLI command.

then it just echoed $path on command line
see my screenshot below

vineet

it works for me … though I don’t use windows. seems to be a *NIX command only.

Using a windows console window

echo %PATH%

Of course after doing this you won’t understand what it is telling you or how to change it.

We have reached the point of diminishing returns. You need to stop and learn at least the basics of your operating system to understand what is going on. Or get a geek friend to come over and fix it for you.

1 Like

i have pasted my path screenshot
incase any one else would like to comment on it

why are you using such a long dead version of PHP - 5.6 is the earliest version still supported now - any security holes found in 5.5 or earlier will remain to be exploited forever.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.