Configurations and Other Settings
PHPStorm - PHP Template Changes
- Ensure that anything you want to add to the template(s) is on your clipboard ready to be pasted.
- Open Settings -
CTRL+ALT+S (PC)
orCMD + , (MAC)
- Locate the
Editor
option - Locate the
File and Code Templates
option - Click on the
Includes
tab - Select the
PHP File Header
option - Click in the editor area next to (on the right of) the
PHP File Header
option - Paste/Make the changes in this space
- Click
Ok
- Verify it works be generating a new PHP file inside of a PHPStorm project.
Example PHP header template:
/**
* Title of Application/Code/Class
*
* Short Description if required (delete if not)
*
* Filename: ${FILE_NAME}
* Project Name: ${PROJECT_NAME}
* Author: FULL_NAME <FIRST_NAME.LAST_NAME>
* Date Created: ${DATE}
*
*/
PHPStorm - PHP CLI Interpreter Configuration
- To enable the built in PHP development server(s) use:
- Open Settings (CTRL+ALT+S)
- Click on PHP, Locate CLI Interpreter, and click on the …
- Click on the
+
symbol on the newly opened window to add a new interpreter - Select the “Local Path to Interpreter” option.
- Rename the interpreter from the default
PHP
toPHP 8.1
(or whatever version you intend to use) - Navigate to your PHP interpreter (php.exe) (typically located in your C drive on Windows)
- Click
Apply
thenOk
- Back in the Settings window you should now see the interpreter in the
CLI Interpreter
box. - You may now also change the
PHP language level
to matcch your PHP version. Doing so will enable PHPStorm to check that your code follows appropriate standards. - Now to ensure that it is working:
- Hover over an open PHP document in PHPStorm.
- The browser icons should show.
- Click on the icon of the browser you wish to use to open the file.