简体   繁体   中英

PHP Composer and PhpStorm - PHP 5.3.3 to 7.4

I am wanting to check PHP 5.3.3 scripts for compatibility to upgrade to PHP 7.4. I have PhpStorm 2022.1.2.

I gather I need to install PHP_CodeSniffer, probably in PhpStorm for convenience.

Composer seems to want PHP installed on my development computer (which is separate from my server...). Is there an alternative to this? Or how should Composer be installed without PHP on my local machine?

Composer seems to want PHP installed on my development computer (which is separate from my server...). Is there an alternative to this?

An alternative of having PHP installed on your local machine, is to install PHP in a virtual environment of your local machine.

You can do this with Docker. PHP Docker image: https://hub.docker.com/_/php

Additionally install Composer in your Docker image: https://getcomposer.org/download/

Then you can bash into the Docker container. In that container you can install all packages you want and run Composer.

At the end, PHP and Composer are not installad on your local machine directly, they are installed in the virtual environment of Docker (in a container) on your local machine.

Composer seems to want PHP installed on my development computer (which is separate from my server...). Is there an alternative to this?

https://hub.docker.com/_/composer

It will ship with PHP.

And in general you can't run Composer without PHP because it needs it to run.

It is just that within the Composer Docker container, there is PHP, too. So you install it by pulling the container.


Depending which operating system you're using and if you're concerned about the development environment(s), nix-shell(1) and nix-env(1) could be appropriate as well with more flexibility than Docker containers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM