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
Editoroption - Locate the
File and Code Templatesoption - Click on the
Includestab - Select the
PHP File Headeroption - Click in the editor area next to (on the right of) the
PHP File Headeroption - 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
PHPtoPHP 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
ApplythenOk - Back in the Settings window you should now see the interpreter in the
CLI Interpreterbox. - You may now also change the
PHP language levelto 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.