PhpStorm 2023.3 Help

Import an existing project

You can set up a PhpStorm project around the existing source code created in another IDE or in a dedicated editor. PhpStorm analyzes the code base and adds a .idea directory with settings to it.

Open a project (simple import)

If you are not going to use a Web server in your project right now, you can just open the folder with the project files. This option imports the selected project to PhpStorm as is (opens it).

  1. Launch PhpStorm.

    If the Welcome screen opens, click Open.

    Otherwise, go to File | Open in the main menu.

  2. In the dialog that opens, select the directory in which your sources, libraries, and other assets are located and click Open.

  3. If you have been working with another project, select whether you want to open the new project in a new dialog or in the current one.

Open source files and set up a Web server

If, besides source files, you have a Web server configured for application deployment, use the New Project From Existing Files wizard to set up your PhpStorm project. The wizard covers different scenarios corresponding to different source files location and server configurations (in-place, local, or remote), and takes you through configuring folders under the project root.

Web server is installed locally, source files are located under its document root

  1. Select File | New Project from Existing Files from the main menu.

  2. On the Choose Your Scenario page, choose Web server is installed locally, source files are located under its document root and click Next.

  3. On the Choose Project Directory page, select the folder where your sources are stored and click the Project icon icon on the toolbar or choose Project Root from the context menu of the selection to appoint the folder project root. PhpStorm marks the selected folder with the Project icon icon.

  4. Configure the folders under the project root. Alternatively, you can do it later in Settings (Ctrl+Alt+S) | Directories. Click Next.

  5. On the Specify Local Server page, appoint the server access configuration to use. For more information, refer to Configure synchronization with a server.

    Do one of the following:

    • Choose Use existing server and select the relevant server configurations from the list. The list contains only configurations of the type In-place marked withicon_inplace_server.png, because your files are already under the server document root.

    • Choose Add new local server, click Next, and define a new server access configuration on the Add Local Server page that opens:

      1. Specify the server configuration name in the Name field. PhpStorm itself sets the configuration type to In-place.

      2. In the Web server URL field, type the URL address associated with the document root of your server as defined in the server configuration file. This URL address will be the starting point for building the URL address of your application.

        Both the HTTP and the HTTPS protocols are supported.

        For example, the default document root is set to the htdocs folder, and the default URL address to access the data in it is http://localhost. If you have changed the default port 80, you have to specify the port explicitly: http://localhost:<port>.

        Click Next when ready.

      3. On the Specify Web Path page, specify the URL address to access your project root folder. In the Web path for project root field, type the path to the project root folder relative to the server document root specified in the server configuration file. As you type, PhpStorm dynamically builds the URL address and shows as a link in the Project URL read-only field. To check that the URL address is constructed correctly and ensures access to the project root, click the link.

      For more information, refer toCreate an in-place server configuration.

  6. Click Create and specify the project window opening option.

Web server is installed locally, source files are located elsewhere locally

  1. Select File | New Project from Existing Files from the main menu.

  2. On the Choose Your Scenario page, choose Web server is installed locally, source files are located elsewhere locally and click Next.

  3. On the Specify Local Path page, appoint the project root. Specify the folder where the sources are stored and where the project will be created.

  4. On the Specify Server page, appoint the server access configuration to enable interaction with the server. For more information, refer to Configure synchronization with a server.

    Do one of the following:

    • Choose Use existing server and select the relevant server configurations from the list. The list contains only configurations of the type Local marked the icon_local_server.png, because your files are stored locally on your machine but under the server document root, so a configuration of the In-place type would not fit.

    • Choose Add new local server, click Next, and define a new server access configuration on the Add Server page, that opens:

      1. Specify the server configuration name in the Name field. PhpStorm itself sets the configuration type to Local.

      2. In the Folder field of the Upload/download project files area, specify the server configuration root.

        The server configuration root is the highest folder in the file tree on the server that can be accessed through the server configuration. The easiest way is to use the document root of your server as defined in the server configuration file. However, you can appoint any other existing folder under the document root.

      3. In the Web server URL field of the Browse files on server area, specify the URL address of the server configuration root. This URL address will be the starting point for building the URL address of your application. Depending on your choice of the server configuration root, do one of the following:

        • Type the URL address associated with the document root of your server as defined in the server configuration file.

        • Type the URL address in the following format:

          <Server document root URL>/<path to the folder relative to the server document root>

        Click Next.

      For more information and examples, refer to Create a local server configuration.

  5. On the Create New Project: Choose Remote Path page, create a folder on the server where PhpStorm will upload the project files. This folder is called project root on the server and it will be automatically mapped to your project root.

    The page shows a tree of the folders under the appointed server configuration root. Select the relevant parent folder and choose Create Folder on the context menu. When the new folder appears in the tree, select it and click the project_icon.png icon on the toolbar or choose Project Root on the context menu of the selection. PhpStorm marks the selected folder with the project_icon.png icon.

    Configure the folders under the project root. Alternatively, you can do it later in Settings (Ctrl+Alt+S) | Directories. Click Next.

  6. On the Specify Web Path page, specify the URL address to access your project root folder on the server which you appointed in the previous step. In the Web path for project root field, type the path to the folder relative to the server configuration root. Actually, type the relative path to the project root on the server field. As you type, PhpStorm dynamically builds the URL address and shows it as a link in the Project URL read-only field.

  7. Click Create and specify the project window opening option.

Web server is on remote host, files are accessible via network share or mounted drive

  1. Select File | New Project from Existing Files from the main menu.

  2. On the Choose Your Scenario page, choose Web server is on remote host, files are accessible via network share or mounted drive and click Next.

  3. On the Create New Project: Specify Local Path page, specify the name of the project to be set up and the local folder to download the project sources to and click Next.

  4. Select either an existing server or click Add remote server to open the Create New Project: Add Remote Server page. On this page, specify parameters for the new server and click Next.

  5. On the Create New Project: Choose Remote Path page, create a folder on the server where PhpStorm will upload the project files. This folder is called project root on the server and it will be automatically mapped to your project root. Click Next.

  6. On the Specify Web Path page, specify the URL address to access your project root folder on the server which you appointed in the previous step. In the Web path for project root field, type the path to the folder relative to the server configuration root. Actually, type the relative path to the project root on the server field. As you type, PhpStorm dynamically builds the URL address and shows it as a link in the Project URL read-only field.

  7. Click Create and specify the project window opening option.

Web server is on remote host, files are accessible via FTP/SFTP/FTPS/WebDAV

  1. Select File | New Project from Existing Files from the main menu.

  2. On the Choose Your Scenario page, choose Web server is on remote host, files are accessible via FTP/SFTP/FTPS/WebDAV and click Next.

  3. On the Create New Project: Specify Local Path page, specify the name of the project to be set up and the local folder to download the project sources to and click Next.

  4. Select either an existing server or click Add remote server to open the Create New Project: Add Remote Server page. On this page, specify parameters for the new server and click Next.

  5. On the Create New Project: Choose Remote Path page, create a folder on the server where PhpStorm will upload the project files. This folder is called project root on the server and it will be automatically mapped to your project root. Click Next.

  6. On the Specify Web Path page, specify the URL address to access your project root folder on the server which you appointed in the previous step. In the Web path for project root field, type the path to the folder relative to the server configuration root. Actually, type the relative path to the project root on the server field. As you type, PhpStorm dynamically builds the URL address and shows it as a link in the Project URL read-only field.

  7. Click Create and specify the project window opening option.

Source files are in a local directory, no Web server is yet configured

  1. Select File | New Project from Existing Files from the main menu.

  2. On the Choose Your Scenario page, choose Source files are in a local directory, no Web server is yet configured and click Next.

  3. On the Choose Project Directory page, select the folder where your sources are stored and click the Project icon icon on the toolbar or choose Project Root from the context menu of the selection to appoint the folder project root. PhpStorm marks the selected folder with the Project icon icon.

  4. Configure the folders under the project root. Alternatively, you can do it later in Settings (Ctrl+Alt+S) | Directories.

  5. Click Create and specify the project window opening option.

Last modified: 25 March 2024