Skip to content
Advertisement

Is it possible to enable CORS in the PHP CLI server?

Is it possible to enable CORS in the PHP CLI server (and if so, how)?

Edit: To address comments such as I should just include the header in my scripts, note that I do not have any PHP files/scripts in my code. I am simply using the PHP CLI server as a lightweight local hosting option. Thus ideally the answer will provide a CLI option, or show that there is none.

Advertisement

Answer

Start the server with DocumentRoot in webhook folder with php routings script :

JavaScript

webhook/dev-routings.php :

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement