D
D
Danil O'neil2020-09-03 20:07:27
PHP
Danil O'neil, 2020-09-03 20:07:27

How to run php server in vs code?

Please explain to a beginner in php what needs to be done to run the PHP Server extension in VS CODE .

When launching the extension, error windows pop up: 5f512277d5c0d520889128.png

Errors refer to the settings.json file :5f5122b50d5cd566783421.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pychev Anatoly, 2020-09-03
@daniloneil

I have php installed separately. There are articles on the net on how to install php on windows
Be sure to add the path to the php.exe executable file to the PATH variable in the windows settings

"php.validate.enable": true,
"php.validate.run": "onSave",
"php.validate.executablePath": "D:/ospanel/modules/php/PHP-7.2/php.exe",

Write the path to your php executable file
Now when you save the file, VSCode will check it for php errors

D
Danil O'neil, 2020-09-04
@daniloneil

Total:
after installing php on windows, rename php.ini-production to php.ini;
uncomment (remove the sign;) before the lines:

extension=php_curl.dll;
extension=php_gd2.dll;
extension=php_mbstring.dll;
extension=php_openssl.dll;
extension=php_pdo_mysql.dll;
extension=php_pdo_sqlite.dll;
extension=php_sqlite3.dll.

after which we indicate in the settings.json file the answer above from Anatoly Pychev and everything works.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question