search

Home  >  Q&A  >  body text

How to create a localhost using XAMPP to run PHP code?

<p>I've done this but it doesn't work. </p><p>I have a localhost set up for my WordPress but every time I try to create a new localhost it doesn't let me have multiple localhosts. </p><p>Where did I go wrong? I use Visual Studio Code as my code editor, are there any specific settings I need to set? </p><p><br /></p>
P粉419164700P粉419164700484 days ago507

reply all(1)I'll reply

  • P粉111641966

    P粉1116419662023-07-31 09:59:36

    First, you must be convinced that "localhost" works. Try searching for information about sockets and Apache virtual hosts, I believe this will help you.

    Regarding your question...are you using Xampp? If so, you could try splitting multiple projects into different folders (all within httpdocs) so that the access method becomes localhost/proj-a and localhost/proj-b.

    If you are using Docker, or really need a complete unique URL without folders... try setting up your Docker, Nginx, Apache or whatever startup tool you are using to start on the new port (note (live, 80 is the default port), so assuming your Docker will use port 8080, your access method will be localhost:8080.

    If it's not clear yet, try reading my two suggestions and then provide more details, someone will definitely help you.


    reply
    0
  • Cancelreply