Quick Start Guide
In this section:
- Before you start
- Step 1: Open a project in PhpStorm
- Step 2: Explore the user interface
- Step 3: Code with smart assistance
- Step 4: Keep your code neat
- Step 5: Generate some code
- Step 6: Find your way through
- Step 7: Debug your application
- Step 8: Test your code
- Step 9: Keep your source code under Version Control
- Step 10: That’s it! Go ahead and develop with pleasure!
Before you start
PhpStorm is an Integrated Development Environment for PHP developers built on top of the IntelliJ IDEA platform.
What languages does PhpStorm support?
What platforms can I run PhpStorm on?
PhpStorm is a cross-platform IDE that works on Windows, macOS, and Linux.
What are the system requirements to start with PhpStorm?
To run PhpStorm, your need to have 1 GB RAM minimum (2 GB RAM recommended), 1024x768 minimum screen resolution, and fit the following system requirements:
|Microsoft Windows 10/8/7/Vista/2003/XP (incl.64-bit)||macOS 10.5 or higher, including 10.10. Only 64-bit macOS is supported.|| OS Linux 64 bit|
KDE, GNOME or Unity DE desktop
Note that JRE 1.8 is bundled with distributions for all platforms. This means that you don't need any Java to be installed on your machine in order to run PhpStorm.
Find more details about requirements for PhpStorm in Installation requirements.
Configuring PHP environment
Even though PhpStorm is a smart IDE, first you need to inform it which PHP environment we use, where PHP components are stored, and how they are configured.
If you work with a local Web server, use the following tutorials to prepare your environment:
If you work in a Docker container, see Docker Support in PhpStorm.
In this Quick Start Guide, we will set up a pre-configured project in a Vagrant instance. Before you start:
- Download and install Oracle VirtualBox and Vagrant from their official sites.
- Specify the path to Vagrant executable file on the Vagrant page ( for Windows and Linux or for macOS).
Step 1: Open a project in PhpStorm
Everything you do in PhpStorm is done within the context of a project. It serves as a basis for coding assistance, bulk refactoring, coding style consistency, etc.
In this Quick Start Guide, we provide a pre-configured workshop project that already contains a
Vagrantfile. The project is available on GitHub at https://github.com/JetBrains/phpstorm-workshop.
To open this project in PhpStorm and configure the Vagrant environment:
- On the Welcome Screen, click Check out from Version Control and then choose GitHub from the list.
- In the Clone Repository dialog box that opens, type
https://github.com/JetBrains/phpstorm-workshopin the Git Repository URL field, then choose the Parent Directory for the project. PhpStorm will create a project folder automatically, the suggested name is shown in the Directory Name field.
- After the project is cloned, PhpStorm suggests to open it. Open the project and choose on the main menu.
You have other options to start working on a project in PhpStorm as you can see from the Welcome Screen:
Step 2: Explore the user interface
The main PhpStorm window is divided into several logical areas:
- Menus and toolbars that help us execute various commands.
- Navigation bar for navigating through the project.
- Status bar with various information about the entire PhpStorm, the current project or a file in the editor, warnings, and error messages.
- The Editor where you actually write your code. It has tabs for easy navigation between opened files.
- Numerous Tool Windows that perform different functions: help you explore and navigate through the project and file structures, view search and inspection results, run, debug, and test applications, work in interactive consoles, and more.
Step 3: Code with smart assistance
PhpStorm takes care of the routine so that you can focus on the important. Use numerous PhpStorm coding capabilities to create error-free applications without wasting precious time. In the base project, you can interactively try these features on a number of PHP files with code examples and guidelines.
Basic completion (Ctrl+Space) shows the code completion options for the current context and displays the members of the current type in bold: To have more variants shown, press Ctrl+Space once again.
To try basic code completion, open
workshop/02_Editing/01_Completion/1.1_Basic_Completion.php in your project and follow the instructions in the comments.
Smart completion (Ctrl+Shift+Space) analyzes the context you’re currently working in and offers more accurate suggestions based on that analysis filtering the list of functions and variables to match the expression type.
PhpStorm keeps an eye on what you are currently doing and makes smart suggestions, called intention actions, to save more of your time. Intention actions let you apply automatic changes to the code that is correct (in contrast to code inspections that provide quick-fixes for code that may be incorrect).
Your code references a file that does not exist? Not a problem with PhpStorm. Press Alt+Enter and choose Create file <filename>: See the full list of available intention actions on Intentions ( for Windows and Linux or for macOS).
To try various intention actions, open
workshop/02_Editing/05_Intentions/5.1_Intentions.php in your project and follow the instructions in the comments.
Step 4: Keep your code neat
PhpStorm monitors your code and tries to keep it accurate and clean. It detects potential errors and problems and suggests quick-fixes for them.
Every time PhpStorm finds unused code, an endless loop, hidden upper scope, an assignment operator
= in a conditional expression, and many other things that probably require your attention, you’ll see a light bulb. Click it, or press Alt+Enter, to apply a fix.
You forgot a use statement? Press Alt+Enter and click Import class: In the list, click the class to import: PhpStorm imports the selected class and adds a use statement: Try more live examples from
See the full list of available inspections on the Inspections page ( for Windows and Linux or for macOS). You can disable some of them, or enable others, plus you can adjust the severity of each inspection. You decide whether it should be considered an error or just a warning.
Step 5: Generate some code
Writing code can be a lot easier and faster with the code generation options available in PhpStorm. menu (or just Alt+Insert) will help you with generating constructors, getters/setters, PHPDoc comments as well as suggest overriding/implementing some methods (Ctrl+O/Ctrl+I): Try more live examples from
Use live templates (choose or press Ctrl+J) to produce entire code constructs. View the list of available ready-to-use live templates on the Live Templates page ( for Windows and Linux or for macOS ). If you see that you need something especially important for your development, extend this set of templates with your own ones.
Try live examples from
Also, consider surrounding your code with complete constructs. Choose or press Ctrl+Alt+T, then choose the required statement from the pop-up list: Try more live examples from
Step 6: Find your way through
When your project is big, or when you have to work with the code written by someone else, it’s vital to be able to quickly find what you are looking for and dig into the code. This is why PhpStorm comes with a set of navigation features that will help you find your way through any code no matter how tangled it is.
To find where a particular symbol is used in your project, PhpStorm suggests full-scale search via Find Usages (Alt+F7): You also have the option to search only in the current file (Ctrl+F), or within a directory, any arbitrary scope, or the entire project (Ctrl+Shift+F).
To try basic search, open
workshop/01_Navigation/05_Find_usages/5.1_Highlight_Usages_in_File.php in your project and follow the instructions in the comments.
You can tell a lot just looking at your File Structure, with its imports or call hierarchies, and possibly use it to navigate through your code with the help of powerful navigation actions.
- Search Everywhere lets you search for classes, file, symbols and menu actions all at once as well as navigate to them. To launch Search Everywhere, click the magic glass icon in the upper-right corner of the PhpStorm window or press Shift twice. If you do not specify any search pattern, PhpStorm just shows a list of recent files where you can navigate to the relevant item by clicking it: To search for something specific, type a search pattern. Note that besides symbols, Search Everywhere can find actions: In the Search Everywhere mode, PhpStorm even accepts CamelHumps and recognizes middle matches.
To try various ways to use Search Everywhere, open
workshop/01_Navigation/01_Navigate_to_something_you_know/1.6_Search_everywhere.mdin your project and follow the instructions.
Of course navigation to a Class (Ctrl+N), a File (Ctrl+Shift+N), or a Symbol (Ctrl+Shift+Alt+N) by its name is also at your disposal, see Navigating to Class, File or Symbol by Name.
- Go To Declaration (Ctrl+B, Ctrl+Click for Windows and Linux or ⌘+Click for macOS) brings you to the location where a particular symbol is first declared. This type of navigation works from any place in the source code, even from another class or comment.
To try navigating through Go to Declaration, open
workshop/01_Navigation/02_Navigate_to_Declaration/2.1_Go_to_declaration.phpin your project and follow the instructions in the comments.
- Go to Implementation (Ctrl+Alt+B) brings you to the implementation of a particular class. If there are several implementations, PhpStorm shows them in a list where you can select the relevant one to navigate to:
To try navigating through Go to Implementation, open
workshop/01_Navigation/04_Navigate_class_hieracrhies/4.1_Go_to_Implementation.phpin your project and follow the instructions in the comments.
Navigate through the timeline
PhpStorm automatically keeps track of the changes you make to the source code, the results of refactoring, etc. in the Local History. Contrary to traditional Version Control Systems, Local History is always enabled. To view it for a file or a folder, choose on the main menu. Here you can review the changes, revert them (), or create a patch ():
To try using Local History yourself, open
workshop/09_Version_Control/07_Local_History.php in your project and follow the instructions in the comments.
Step 7: Debug your application
Does your application do exactly what it is intended to? If it does not, you will have to do some debugging to find out what causes the problem. Luckily, our sample project already has Xdebug installed and configured.
Configure the PHP interpreter
In our project, the Vagrant box already contains a PHP interpreter and you only need to tell PhpStorm where it is.
- Open the PHP page ( for Windows and Linux or for macOS) and click next to the CLI Interpreter field.
- In the CLI Interpreters dialog that opens, click in the left-hand pane and choose From Docker, Vagrant, VM, Remote... from the list.
- In the Configure PHP Remote Interpreter Dialog that opens, choose Vagrant. PhpStorm detects the PHP interpreter and brings you back to the CLI Interpreters dialog where the versions of the detected interpreter and Xdebug are shown. That's all - just click OK.
Debugging starts with placing breakpoints at which program execution will be suspended, so you can explore program data. Just click the left gutter of the line where you want the breakpoint to appear:
To play with breakpoints yourself, open
workshop/06_Debugging/03_Breakpoints.php in your project and follow the instructions in the comments.
In the Project tool window, select
workshop/06_Debugging/03_Breakpoints.php and choose Debug 03_Breakpoints.php on the context menu: PhpStorm starts a debugging session and opens the Debug Tool Window where you can step through the suspended program, view variable values, evaluate expressions, and much more. Try more live examples from
See also Zero-Configuration Debugging with Xdebug for alternative debugging scenarios.
Step 8: Test your code
Write your tests
Navigate to the class to test and press Ctrl+Shift+T. From the pop-up list, choose Create New Test: In the dialog box that opens, all the fields are filled in so just click OK. PhpStorm generates a test class
<class_to_test>Test and opens it in the editor. Write your tests as required.
To try writing tests yourself with PhpStorm coding assistance, open
workshop/08_Testing/01_Writing_Tests.php and follow the instructions in the comments.
Launch the test
Open the file with your tests in the editor or click it in the Project tool window and choose Run <class_to_test>Test. This launches the PHPUnit run configuration that PhpStorm has generated for you automatically. You can also create a run configuration ( ) of the type Behat, PHPSpec, or Codeception, select it from the drop-down list on the toolbar, and then click . PhpStorm shows the results in the Test Runner Tab of the Run Tool Window.
Step 9: Keep your source code under Version Control
If you are keeping your source code under version control, you will be glad to know that PhpStorm integrates with many popular version control systems: Git (or GitHub), Mercurial, Perforce, TFS, Subversion and CVS. To specify credentials and any settings specific to a particular VCS, go to Version Control ( for Windows and Linux or for macOS).
The Changes pop-up view ( or Alt+9).menu will give you a clue about what commands are available. For example, you can see the changes you’ve made, commit them, create changelists and much more from the
Step 10: That’s it! Go ahead and develop with pleasure!
We hope this brief overview of essential PhpStorm features will give you a quick start. There are many important features that make a developer’s life easier and more fun, and their source code neater and cleaner. Take these first few steps now, and then dig deeper when you feel the time is right. Enjoy PhpStorm!
With any questions please visit our PhpStorm Discussion Forum, twitter, and blog, where you can find news, updates, and useful tips and tricks. Also, don't hesitate to report any problems to our support team) or the PhpStorm issue tracker.