When I run the bin\cake server, the console shows that the ini path is empty, "C:\xampp\php' is not recognized as an internal or external command, operable program or batch file" is another error. Localhost refuses to connect.How do I fix it?

C:\xampp\htdocs\cms2>bin\cake server

Welcome to CakePHP v4.4.17 Console

App : src
Path: C:\xampp\htdocs\cms2\src
DocumentRoot: C:\xampp\htdocs\cms2\webroot
Ini Path:

built-in server is running in http://localhost:8765/
You can exit with CTRL-C
‘C:\xampp\php’ is not recognized as an internal or external command,
operable program or batch file.

This is a problem related to your local PHP installation, not CakePHP.

But instead of using the builtin webserver I would recommend you use what XAMPP is already providing - meaning configure your Apache to have a vHost setup to your C:\somepath\to\your\cakephp\webroot and let it handle the webserver.