Kindly make use of this information here. https://dev.to/devabdul/building-a-contact-form-with-react-and-php-ae7
Also look into how you to run the php server correctly example below cd into the folder where your php file is located php -S localhost:8000
3.Enable CORS access with a sample below in you php file header
header("Access-Control-Allow-Origin: http://localhost:4000");