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).
Launch PhpStorm.
If the Welcome screen opens, click Open.
Otherwise, go to
in the main menu.In the dialog that opens, select the directory in which your sources, libraries, and other assets are located and click Open.
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
Select
from the main menu.On the Choose Your Scenario page, choose Web server is installed locally, source files are located under its document root and click Next.
On the Choose Project Directory page, select the folder where your sources are stored and click the 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 icon.
Configure the folders under the project root. Alternatively, you can do it later in Settings (Ctrl+Alt+S) | Directories. Click Next.
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 with, 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:
Specify the server configuration name in the Name field. PhpStorm itself sets the configuration type to In-place.
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.
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.
Click Create and specify the project window opening option.
Web server is installed locally, source files are located elsewhere locally
Select
from the main menu.On the Choose Your Scenario page, choose Web server is installed locally, source files are located elsewhere locally and click Next.
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.
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 , 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:
Specify the server configuration name in the Name field. PhpStorm itself sets the configuration type to Local.
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.
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.
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 icon on the toolbar or choose Project Root on the context menu of the selection. PhpStorm marks the selected folder with the icon.
Configure the folders under the project root. Alternatively, you can do it later in Settings (Ctrl+Alt+S) | Directories. Click Next.
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.
Click Create and specify the project window opening option.
Web server is on remote host, files are accessible via network share or mounted drive
Select
from the main menu.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.
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.
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.
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.
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.
Click Create and specify the project window opening option.
Web server is on remote host, files are accessible via FTP/SFTP/FTPS/WebDAV
Select
from the main menu.On the Choose Your Scenario page, choose Web server is on remote host, files are accessible via FTP/SFTP/FTPS/WebDAV and click Next.
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.
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.
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.
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.
Click Create and specify the project window opening option.
Source files are in a local directory, no Web server is yet configured
Select
from the main menu.On the Choose Your Scenario page, choose Source files are in a local directory, no Web server is yet configured and click Next.
On the Choose Project Directory page, select the folder where your sources are stored and click the 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 icon.
Configure the folders under the project root. Alternatively, you can do it later in Settings (Ctrl+Alt+S) | Directories.
Click Create and specify the project window opening option.