Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

https://github.com/microsoft/azure-pipelines-yaml/blob/master/templates/php.yml Not working #613

Open
pritam97 opened this issue Aug 21, 2024 · 3 comments

Comments

@pritam97
Copy link

While setting up php version 8.2 getting below error

update-alternatives: error: alternative /usr/bin/php8.2 for php not registered; not setting
update-alternatives: error: alternative /usr/bin/phar8.2 for phar not registered; not setting
update-alternatives: error: alternative /usr/bin/phpdbg8.2 for phpdbg not registered; not setting
update-alternatives: error: alternative /usr/bin/php-cgi8.2 for php-cgi not registered; not setting
update-alternatives: error: alternative /usr/bin/phar.phar8.2 for phar.phar not registered; not setting

@aleksandrlevochkin
Copy link

Hi @pritam97, thank you for the question. Can I ask what pool you use in your pipeline? Do you use an MS hosted or self-hosted agent?

For example, for ubuntu-2204 the latest preinstalled version of PHP is 8.1.2: https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md#php-tools

In any case, I think you can install the version of PHP that you need in an earlier step in your pipeline and then use the same set of update-alternatives commands to set up symlinks

@pritam97
Copy link
Author

I am using microsoft hosted agent, but i want use php 8.2 or 8.3 above yaml is not working

@aleksandrlevochkin
Copy link

@pritam97 I think you can use a command from your distribution's package manager that will download the needed version of php just before this line:

sudo update-alternatives --set php /usr/bin/php$(phpVersion)

Or you can switch to a pool such as ubuntu-2004, which has php 8.2 and 8.3 preinstalled: https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2004-Readme.md#php-tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants