Recargar archivos PHP en el navegador usando Visual Studio Code






Fuente: https://stackoverflow.com/questions/60678203/is-it-possible-to-use-live-server-for-php-with-autoreload-on-save


For having auto reload in PHP files in Visual Studio Code:

  1. Install Live Server extension.
  2. Install PHP Server extension.
  3. Config PHP Server: (PHP Config Path), (PHP Path).
  4. Install Google Chrome Live Server extensions.
  5. Open your PHP file in Visual Studio Code and 'Click to run Lie Server'.
  6. Copy the opened page address and past it in "Live Server Address" in live server chrome extension and click Apply.
  7. Switch again to Visual Studio Code and right click on your PHP file and click on "PHP Server: Reload server", it will open your PHP file in browser and just copy IP and port (for example: http://localhost:3000) and paste it on "Actual Server Address" in live server of Google Chrome extension and click apply.
  8. Turn On live Reload in live server of chrome extension. Now whenever you run your PHP file with "PHP Server: Reload server", it will reload automatically on each saving.


Note: For having good experience of automatically reload active Autosave and set 400ms for its delay.




Comentarios

Entradas populares