michal-kocarek / PhpOnWindows

Bridge to PHP installed in Bash on Ubuntu on Windows
MIT License
76 stars 15 forks source link

Does not work #8

Open battlekeys opened 6 years ago

battlekeys commented 6 years ago

When I try to add the php.cmd as a new CLI Interpretor in PHPStorm the "Checking PHP Installation" window opens and does not finish at all. If I click the "Cancel" button, the window will close and all the fields will be filled. But "Open php.ini in Editor" give me an error. Please see screenshorts. As a result, xdubug don't work. Could you help me?

error error 2
ruslan-pelepets commented 6 years ago

I will take a look 

Понедельник, 20 ноября 2017, 16:40 +03:00 от battlekeys notifications@github.com:

When I try to add the php.cmd as a new CLI Interpretor in PHPStorm the "Checking PHP Installation" window opens and does not finish at all. If I click the "Cancel" button, the window will close and all the fields will be filled. But "Open php.ini in Editor" give me an error. Please see screenshorts. As a result, xdubug don't work. Could you help me?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub , or mute the thread .

battlekeys commented 6 years ago

Did you look?

ruslan-pelepets commented 6 years ago

Everything should work fine. Here is my conf. To edit php.ini run bash.exe and add xdebug there. And yes, checking could not work, press cancel checking and then OK button. https://user-images.githubusercontent.com/29253087/33225490-442b7f52-d181-11e7-8396-9292711ef443.png

battlekeys commented 6 years ago

The problem is not in editing php.ini. The problem is the PhpStorm does not stop at breaking points. I have 2 configurations: one for OpenServer and one for WSL. The configuration for OpenSrever is working without any problem. The WSL configuration does not work.

ruslan-pelepets commented 6 years ago

Show your xdebug config from WSL

battlekeys commented 6 years ago

Here is my php.ini connfig: [Xdebug] zend_extension = /usr/lib/php/20151012/xdebug.so xdebug.remote_autostart=1 xdebug.remote_enable=1 xdebug.remote_handler="dbgp" xdebug.remote_host="localhost" xdebug.remote_port=9001 xdebug.remote_mode=req xdebug.idekey="PHPSTORM"

ruslan-pelepets commented 6 years ago

So yes, i cant debug too, in my case i am trying to run phpunit but it cant find ide-phpunit.php. Try to use almost same php versions on windows and linux 7&7 or 5&5.

battlekeys commented 6 years ago

I use the same php versions on windows and linux: both are php7.0 But it does not help: debug does not work. Is it possible to fix it?

ruslan-pelepets commented 6 years ago

The only option now is to use ssh tunel for CLI scripts debug, check this: https://mobilefish.de/debugging-php-cli-scripts-phpstorm-which-are-running-inside-remote-server

ruslan-pelepets commented 6 years ago

The other option - check Stop in the first line in debug options window and you will see the error and possible solution from jetbrains

battlekeys commented 6 years ago

Then, as I believe, is your extension absolutely useless? Is it not working in any case at all?

ruslan-pelepets commented 6 years ago

It worked before)) Try this https://user-images.githubusercontent.com/29253087/33229839-ee49a1d6-d1df-11e7-8e20-a937f98ec8b6.png P.S. And it is not mine)) I have only patched it to use with php unit

battlekeys commented 6 years ago

Yes but not now. It's a pity. Thank you for your attention. If you find any solution in the future please let me know.

battlekeys commented 6 years ago

https://user-images.githubusercontent.com/29253087/33229839-ee49a1d6-d1df-11e7-8e20-a937f98ec8b6.png

How did you see this error? I don't have any info in my debug variables ...

ruslan-pelepets commented 6 years ago

Ok, i've managed it.

  1. Add server 127.0.0.1 or 0.0.0.0 and add path mapping windows vs linux https://confluence.jetbrains.com/display/PhpStorm/Debugging+PHP+CLI+scripts+with+PhpStorm#DebuggingPHPCLIscriptswithPhpStorm-2.StarttheScriptwithDebuggerOptions
  2. Open php-bridge.php and before line $linuxCmd = ($envValues ? $envValues . ' ' : '') . 'php ' . implode(' ', $arguments); add this $envValues = ' PHP_IDE_CONFIG="serverName=!heReYourServerInStormMapping!"';
  3. The debug session started working after adding PHP_IDE_CONFIG env AND deleting another env XDEBUG_CONFIG=idekey=...
  4. Last PHPStorm is cnanged so we should provide fix for php-bridge.php

And enjoy))

ruslan-pelepets commented 6 years ago

proof 2017-11-25_1442 servers settings tmp source code changes php-source

ruslan-pelepets commented 6 years ago

Checkout new fixed version here - https://github.com/ruslan-pelepets/PhpOnWindows

ruslan-pelepets commented 6 years ago

Fixed path trasnlation, no need anymore in PHP_IDE_CONFIG env param)) Follow old readme for IDE setup.