Command to get composer to self-update to the latest sub-sub-version - composer-php

I'm trying to write an alias to run something like composer self-update x.y.z where the command installs the composer specified version of x.y (say, 2.2 or 2.3 or 2.4) but where z is automatically determined to be the highest stable number found. The purpose is to switch easily between compatible composer versions of different major PHP versions (like 5 or 8) for the projects I have to work with.
The command right now makes me specify the specific z version (which could be 0, 11, 18, whatever), otherwise errors (like '2.2 not found' or '2.3 not found' etc).
Example of output causing me cognitive dissonance:
% composer self-update 2.2
Warning: You forced the install of 2.2.18 via --2.2, but 2.4.2 is the latest stable version. Updating to it via composer self-update --stable is recommended.
Upgrading to version 2.2 (2.2.x channel).
[InvalidArgumentException]
Version "2.2" could not be found.
It's strange that it says I "forced the install of 2.2.18" but then tries to use specific version 2.2 (not 2.2.0) then tells me it doesn't exist :facepalm:. To me this is just weird counter-intuitive behavior, so I'd like to find a smart way I don't have to look up which sub-sub-version is the latest (since 2.2 is LTS, and any sub-version could have sub-sub-version updates anyway that could be useful).

You're using the wrong command if you'd like to stay on the 2.2 LTS channel (it covers your different PHP versions), the correct one is with --2.2, you don't provide the major/minor version verbatim, but the channel:
$ php composer.phar self-update --2.2
Warning: You forced the install of 2.2.18 via --2.2, but 2.4.2 is the latest stable version. Updating to it via composer self-update --stable is recommended.
You are already using the latest available Composer version 2.2.18 (2.2.x channel).
It still gives the hint how to update to the latest actually, but as you can further on see, it looks up the latest in 2.2.x and sees it is the same so quits without downloading and exit status 0 (which is fine/OK/success).
You can find the same command-line option (--2.2) with the installer btw.:
$ curl -sS https://getcomposer.org/installer | php -- --2.2
All settings correct for using Composer
Downloading...
Composer (version 2.2.18) successfully installed to: /home/user/project/composer.phar
Use it: php composer.phar
Just keep in mind to use --help if things are happening you were not expecting, especially with utilities you learn about their invocation still that is.
(and yes, the warning message can not be fully understood when the expectation is to provide major/minor verbatim and getting another error for that. it showed a hint about --2.2 already thought.)

Related

I am trying to install civicrm on my Mac and I got error in step no 5

I am trying to install CiviCRM on my laptop through Drupal 8.
please help me with this error.
This is simply that your version of PHP doesn't have the intl extension compiled in.
How you address this, very much depends on how you've installed PHP on your system or, if you haven't at all (and are using the built-in system PHP).
I'm just going to pick a generic route here, and assume this is OSX PHP as some versions don't come with intl support (e.g. PHP 7.3 shipped with macOS Catalina) and say ... Save yourself some time and just use Homebrew to do this. Follow the instructions to install brew, then install your required version of PHP using;
brew update
brew install php#7.3
brew link php#7.3
It likely already has intl support, you can test by using;
php -m | grep intl

Issue installing symfony 3.0 on mac

I am trying to install symfony 3.0 on my macos.
According to their official website, I need to type on my console:
$ sudo curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony
then I type my password
and then I type:
$ sudo chmod a+x /usr/local/bin/symfony
and then, according to the official symfony documentation, there is nothing more simple than typing;
$ symfony new my_project_name
but my console returns a red message that says:
Task "new" is not defined.
This is probably because I already had an old version of symfony installed on my machine, but I am not sure
The problem is that I see little documentation around this.
Probably you are pointing on an old version of the installer.
You can check if is the lastest version with the --version option:
>symfony --version
You can update your current version as following:
1) update your installer
>symfony self-update
or with sudo, depends how you install it:
>sudo symfony self-update
2) Then try again:
>symfony new my_project_name
Hope this help

dnvm can't find latest version from nuget.org

Going through the steps of setting up dnvm on OSX and I can't seem to get past the dnvm upgrade step as it's returning the error:
~$ dnvm upgrade
Determining latest version
Error: Could not find latest version from feed https://nuget.org/api/v2
I can install based off the unstable feed using -u however then I run into a whole new set of issues.
This actually is caused by dnvm not following a redirect to www.nuget.org (instead of without the www). It is fixed with the following line:
export DNX_FEED=https://www.nuget.org/api/v2
Hope that helps
The packages will be available soon:
https://github.com/aspnet/dnvm/issues/235

Install fpm separately for PHP 5.5.8

I'm doing a manual LAMP setup to learn more about working with the terminal and network configuration, and upon installing the latest version of PHP (5.5.8) I realised that I missed installing fpm. I've been trying to install the extension by itself but I'm not sure how to.
Running php-fpm -v tells me I have version 5.4.17, should fpm's version be the same as PHP in order to work together?
If you are using the manual configure option, ensure you have set the --prefix=/path/to/php-5.5.8 and --enable-fpm. And you can run /path/to/php-5.5.8/bin/php after installation.

how to update firefox on redhat via yum

I have firefox 3.0.12 on my redhat 5.8 and I'm trying to update it.
But, yum update firefox does not find and new version and keeps finding only 3.0.12
I have also tried updating yum itself.
I have also tried downloading firefox tgz, but I get a lot of dependency files missing. So going that route is very tedious and I'm finding it hard to download the dependent .so files.
How do I update using yum or is there a .rpm for firefox that I can download and install(I did not find one on the mozilla website)
If yum upgrade firefox does not report any possible updates, you probably do not have proper channels enabled (you are not subscribed into these). You should see rhel-x86_64-server-5 (depends on your architecture and RHEL variant - Server/Client...) in output of command yum repolist. If it is not there you have to register into RHN Classic (rhn.redhat.com) or your company's Red Hat Satellite or something else - depends on your company's policy.
If you have that channel available, upgrade to firefox-31.2.0-3.el5_11.x86_64 (which seems to be latest in RHEL5 channel) should be offered.
Firefox 3.0.12 is the latest version available in repository of 5.8 and so you are getting same. If you need the latest version then upgrade the OS itself or download the rpm manually and install with yum localinstall command.

Resources