How to customize Visual Studio to php development?

Gustavo Pinent 21 Reputation points
2022-06-29T19:12:32.653+00:00

Hi! I have just dropped my Dreamwaver account, too expansive for now. I have developed websites combining php and JavaScrip using Dreamweaver, Blue Fish, Atom (dying) and some apps that opens my website with the files in a box on the left, code the de right (also in tabs) and tools below (errors, depuration, find and replace etc.). When developing in C# (Unity) Visual Studio will have this layout, but when I wish to open the website, I have to open a file and it won't recognize the folder as the project root and will only open the code, nothing else.

Also, I didn't find an option to create a project in php. Is there some third part solution?

Can I work with Visual Studio as Dreamweaver?

Developer technologies Visual Studio Other
0 comments No comments
{count} votes

Accepted answer
  1. Tianyu Sun-MSFT 34,436 Reputation points Microsoft External Staff
    2022-07-05T07:58:33.74+00:00

    Hi @Gustavo Pinent ,

    Welcome to Microsoft Q&A forum.

    it won’t recognize the folder as the project root and will only open the code, nothing else.

    You may need a .sln file/ .xxproj file(usually it’s created by VS automatically and is not manually created) to let VS recognize the project and open it as the whole project.

    For PHP development, you may search here: Visual Studio Marketplace to see if there is any extension that meet your requirements to use in VS for developing PHP.

    BTW, perhaps you can consider using Visual Studio Code.

    Best Regards,
    Tianyu

    • If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

1 additional answer

Sort by: Most helpful
  1. Dillon Silzer 57,826 Reputation points Volunteer Moderator
    2022-06-29T23:15:12.74+00:00

    I'm guessing you are looking to run a live LAMP Stack simulation on Windows. There are two routes:

    A more familiar route that I have worked with in the past:

    1. Run a program such as XAMPP. This will provide an apache server, PHP, and MySQL (db). (https://www.apachefriends.org/)
    2. From the XAMPP htdocs folder you will be able to create and edit PHP files.
    3. You will be able to test localhost (http://localhost or http://127.0.0.1).
    4. If you are looking to use an IDE, look for Eclipse or Netbeans. If you are looking for something simple, you can use Notepad++ and change the language to PHP.

    The second route I'm not overly familiar with, but it looks like a more viable option. This is an answer on Stack Overflow by JAC (https://stackoverflow.com/users/4914644/jac):

    1. Install Live Server extension. (https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer)
    2. Install PHP Server extension. (https://marketplace.visualstudio.com/items?itemName=brapifra.phpserver)
    3. Config PHP Server: (PHP Config Path), (PHP Path).
    4. Install Google Chrome Live Server extensions. (https://chrome.google.com/webstore/detail/live-server-web-extension/fiegdmejfepffgpnejdinekhfieaogmj)
    5. Open your PHP file in Visual Studio Code and 'Click to run Live 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:m 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.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.