Frogg logo

Frogg's web tools

Hand Crafted Tools

Home > dev tools > phpStorm main tool
Welcome on Frogg's web tools | Current date :
18/04/2024

phpStorm - Main tools

  • To exploit the real power of PhpStorm, you will need to have some third-party tools. But It is not mandatory
  • This article will show the manual installation of third party tools to help to understand some mechanims for thoose who want to dig deeper. On Windows there are installers made to facilitate the work
  • In this article I will use c:\dev as third-party tools install path, the goal is to use an automated tool based on this configuration.
  • The final goal is to have a portable phpStorm configuration just by copying c:\dev folder and importing phpSotrm exported configuration file.

PHP

Official download php.net
  • try not to use the 32bit version
    Integers can be from -2,147,483,648 to 2,147,483,647 (~ ± 2 billion).
    After it become a Float, and can cause trouble in some function like dates:
    date("Y-m-d H:i:s", 2114380800000);//1 January 2037 00:00:00 will cause an error on PHP 32bit.

PHP installation

1. Extract the php download files to the desired path, for exemple c:\dev\bin\php in my case.

2. Add PHP to the path, to allow the command php to be called from anywhere.
Add PHP to Path

3. Test the installation using the command php -v
Test PHP installation
  • you can update manually the Path using the dos command :
    SET PATH=%PATH%;c:\dev\bin\php where c:\dev\bin\php is your php path.
  • you can update automatically the Path using the script available there :
    add2path.bat
4. You can copy the php configuration file c:\dev\bin\php\php.ini-development to c:\dev\bin\php\php.ini
  • You can find usefull information about php.ini on official web site : php.net

PHP configuration

phpStorm php configuration phpStorm php configuration

XDebug

Xdebug is an extension for PHP to assist with debugging and development. It contains a single step debugger to use with IDEs; it upgrades PHP's var_dump() function; it adds stack traces for Notices, Warnings, Errors and Exceptions; it features functionality for recording every function call and variable assignment to disk; it contains a profiler; and it provides code coverage functionality for use with PHPUnit.
Official link : https://xdebug.org/

XDebug installation

download from https://xdebug.org/download.php
tips to select the download file using the command "php -v" :
for exeample PHP 7.2 VC15 TS (64 bit)
  • 7.2 is the php version installed
  • 15 is the Visual C++ (CV) version used to compile the .dll
  • 64 is the architecture type (x86 for 32bits or x64 for 64 bits)
btw. TS mean Thread Safe.

the downloaded file has to be put in the PHP "ext" folder (c:\dev\bin\php\ext in my case).
  • The purpose to install thoose third party tools outside the project allow phpStorm to reuse third party tool for any project without reconfiguring them for each project.

XDebug configuration

Editing the php.ini configuration copy to clipboard
zend_extension='xdebug-2.6.0-7.2-vc15-x86_64'
xdebug.profiler_enable=1
xdebug.profiler_output_dir="C:\dev\tmp"
xdebug.cli_color=2
  • Note : php_xdebug(...).dll the prefix php_ and suffix .dll has been removed to have a valid name.

Composer

Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.

Official download getcomposer.org

Another article is available to describe with more detail how works composer : PHP - Composer
  • It require PHP installation first.
  • It require extension openssl enabled in php.ini (extension=openssl).
  • It require extension path configurated in php.ini (extension_dir = "ext").

Composer configuration

phpStorm composer configuration

phpStorm composer.json support plugin

This plugin adds auto completion and inspections support for composer.json file in PHP projects.
phpStorm composer plugin
Generated in 0.004 sec & displayed in ... sec