venerdì 8 novembre 2013

Attivare il debug a riga di commando su PHPStorm da remoto

Ecco un'altra cosa che mancava alla mia vagrant box, la possibilità di effettuare il debug tramite PHPStorm, lanciando il comando dalla shell della vagrant box io vorrei avere il debug sul mio IDE.

Ecco le operazioni necessarie:

  1. Creare in PHPStorm un server (Preferenze->PHP->Servers) con nome ed host uguali usando il file hosts (nel mio esempio ho chiamato il server vagrant.
  2. Verificare che il proprio php.ini abbia queste righe:
    xdebug.profiler_enable=1
    xdebug.remote_enable = 1
    xdebug.remote_port = 9000
    xdebug.remote_handler=dbgp
    xdebug.remote_host=10.0.2.2
    
    Dove 10.0.2.2 è l'indirizzo della mia macchina vista da vagrant, ognuno metterà quello specifico.
  3. Bisogna definire delle variabili per dire a xdebug con chi comunicare: si può fare in due modi, direttamente nella riga di comando oppure usando il comando export:
    con export faccio:
    export XDEBUG_CONFIG="idekey=phpstorm"
    export PHP_IDE_CONFIG="serverName=vagrant"
    
    direttamente a riga di comando scrivo:
    XDEBUG_CONFIG="idekey=phpstorm" PHP_IDE_CONFIG="serverName=vagrant" e poi il file php
A questo punto attivando la cornetta in PHPStorm (il listener delle connessioni) e lanciando il comando su vagrant il debug ha inizio.

5 commenti:

  1. Excellent post. I was checking constantly this blog and I’m impressed! Very useful information particularly the ultimate phase.I handle such info a lot. I used to be looking for this particular information for a very long time. Thanks and best of luck.…PhpStorm 2021.2 Crack

    RispondiElimina
  2. What's going on at Wynn casino? - JTG Hub
    › news › the-nwitts-maine › news › the-nwitts-maine Jan 7, 2020 — Jan 7, 2020 김제 출장안마 Wynn 구미 출장샵 casino 오산 출장마사지 is open for business, Wynn Las Vegas announced Thursday. It's the second-biggest expansion in the 전라남도 출장샵 Wynn Resorts' nearly 안성 출장샵 700-room property

    RispondiElimina
  3. Wow, amazing block structure! How long
    Have you written a blog before? Working on a blog seems easy.
    The overview of your website is pretty good, not to mention what it does.
    In the content!
    vstkey.com
    PhpStorm Crack

    RispondiElimina

  4. I guess I am the only one who came here to share my very own experience. Guess what!? I am using my laptop for almost

    the past 6 years, but I had no idea of solving some basic issues. I do not know how to

    Download Cracked Pro Softwares
    But thankfully, I recently visited a website named Crack Software Free Download
    All Pro Cracked Softwares Download
    PhpStorm Crack

    RispondiElimina
  5. We have enabled e-mail notifications—you will now receive an e-mail if you receive a reply to your comment, could be} an update to a comment thread you comply with or if a user you comply with comments. Visit our Community Guidelines for more data and details on how to to|tips on how to} modify your e-mail settings. Ocado enters South Korea with Lotte Shopping deal LONDON — Ocado Group, the British online grocery store and technology group, has entered the 원 엑스 벳 South Korean market by way of a partnership deal with Lotte Shopping, the companies stated on Tuesday. LONDON — Ocado, the British online grocery store and technology group, has entered the South Korean market by way of a partnership deal with Lotte Shopping , the companies stated on Tuesday. Local time Sunday (4 a.m. ET), the variety of individuals injured had risen to 133, of whom 37 were critically injured, the ministry stated. MGM China's Cotai on line casino in Macau was locked down on Sunday after a dealer examined optimistic for COVID-19, city authorities on the earth's greatest gambling hub stated, ordering everybody inside to remain put till Nov 1.

    RispondiElimina