沉冰浮水

沉冰浮水

做最终到的事,成为最终成为的人!
github
bilibili
mastodon
zhihu
douban

Setting the "php.validate.executablePath" in remote CentOS in VSCode

CentOS Linux is going to stop maintenance, but it's troublesome to switch..

I will remotely edit and test some things, and mount them into Docker for execution.

VSCode always prompts that php.validate.executablePath is not set, although it doesn't seem to have any impact afterwards.

I will try to install PHP separately on the host machine for VSCode.

Remote Development - Visual Studio Marketplace

# Install directly
yum install php

php -v
# PHP 5.4.16 (cli) (built: Apr  1 2020 04:07:17)
# ↑ The version is slightly lower

whereis php
# php: /usr/bin/php /usr/lib64/php /etc/php.d /etc/php.ini /usr/share/php /usr/share/man/man1/php.1.gz

Indeed, I don't quite understand:

{
"php.validate.executablePath": "/usr/bin/php"
}

I researched the official SCL of CentOS, but it doesn't seem to match my expectations.

# Install SCL (Software Collections)
yum install centos-release-scl-rh

# Search
yum search php
# rh-php73.x86_64
# ↑ Probably install this one

yum install rh-php73.x86_64

# List the libraries installed by scl
scl -l
# rh-php73

scl enable rh-php73 "php -v"
# PHP 7.3.29 (cli) (built: Aug  3 2021 12:26:40) ( NTS )

cd /opt/rh/rh-php73 && ls
# deregister  deregister.d  enable  register  register.content  register.d  root
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.