PHP作曲家和PHPSTORM -PHP 5.3.3至7.4
我想检查PHP 5.3.3脚本以升级到PHP 7.4。我有phpstorm 2022.1.2。
我收集到我需要安装php_codesniffer,可能是为了方便起见。
作曲家似乎希望在我的开发计算机上安装PHP(这与我的服务器分开...)。有其他选择吗?还是在我本地机器上没有PHP的情况下如何安装作曲家?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在本地计算机上安装PHP的另一种选择是在本地机器的虚拟环境中安装PHP。
您可以使用Docker做到这一点。 php docker映像: https://hub.docker.com/__/php
另外在您的Docker映像中:
” 。在该容器中,您可以安装所需的所有软件包并运行作曲家。
最后,PHP和作曲家未直接在本地机器上安装,而是将它们安装在本地计算机上的Docker(在容器中)的虚拟环境中。
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.
https://hub.docker.com/_/composer
它将与PHP一起发货。
通常,您不能没有PHP来运行作曲家,因为它需要运行。
只是在作曲家Docker容器中,也有PHP。因此,您通过拉动容器来安装它。
取决于您正在使用的操作系统,如果您担心开发环境,
nix-shell(1)
和nix-env(1)
可以比Docker容器更合适,并且具有更大的灵活性。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)
andnix-env(1)
could be appropriate as well with more flexibility than Docker containers.