ziishaned / live-php

An integrated scratchpad for PHP
41 stars 0 forks source link

The Extension Not working on VSCode Windows #1

Open a-h-abid opened 5 years ago

a-h-abid commented 5 years ago

Hi, I just tried installing the extension. I created a php file and using the command palette ran "HugoBot: Start on current on". But no output is shown. I have PHP installed in system using XAMPP.

Let me know if you need any more info.

My Machine: VSCode 1.30.2 Windows 10 Enterprise 64 Bit XAMPP with PHP 7.0

Karimaljandali commented 5 years ago

I am having the same issue when I run HugoBot: Start on current on. The only other extensions I have are PHP Debug and PHP IntelliSense. I have also tried running the code with Apache running and Apache not running, this did not change any results. I have my workspace configured with the following settings.json: { "php.validate.executablePath":"C:/xampp/php/php.exe", "php.suggest.basic": false, "git.ignoreLimitWarning": true, "php.executablePath": "C:/xampp/php/php.exe" } The code that I am trying to run is a simple file: $item = 1; $item2 = 2; if($item == 1){ echo $item; }else{ echo $item2; } When I call the Hugebot start command, nothing changes at all. I do see HugeBot in the Output dropdown box: screenshot_1

The extension is very promising but unfortunately I can't run it.

My Machine: XAMPP with PHP 7.2 Windows 10 Enterprise 64 Bit VSCode 1.30.2

ziishaned commented 5 years ago

Can you please confirm if PHP is accessible on your CLI and share the output of `php --version?

Karimaljandali commented 5 years ago

screenshot_2

Here is a screenshot of me running php --version from the command prompt. Please let me know what else I can do to assist you. Have you tried installing Hugobot on a fresh install of Visual Studio Code? Maybe you could show the steps you did to get it set up for new users.

ziishaned commented 5 years ago

@a-h-abid @Karimaljandali The issue has been fixed in the new release can you please update the extension and check

peter279k commented 5 years ago

@ziishaned, I have the same issue on Ubuntu 16.04.

Finally it's worked fine after installing the latest hugonot version on Ubuntu 16.04.

Thank you for your help.

a-h-abid commented 5 years ago

@ziishaned The extension auto-updated to 0.0.14. Unfortunately it is not working. After selecting start on file first time, the output box opens and that's all it does. Changing does not do anything. I closed the output box, Then stopped & then started again, but no affect and this time output box does not open auto.

I can access my php from CLI. My settings.json has php executable path like so:

    // Points to the php executable.
    "php.validate.executablePath": "C:\\xampp\\php\\php.exe",
Karimaljandali commented 5 years ago

@ziishaned I updated the extension to 0.0.14. Unfortunately, I am experiencing the same issues as @a-h-abid . Nothing happens when I run the start command. Let me know if there is anything I can do to assist.

peter279k commented 5 years ago

@a-h-abid , @Karimaljandali. Finally, I found the possible issue about this extension isn't worked on Windows VS code.

After tracing error from VS code developer console, we can find the following screenshot picture:

default

It looks like the extension cannot connect the 1270.0.1:8000 server and extension will start the embedded PHP server with 127.0.0.1:8000 automatically.

However, the localhost will be set on Windows by default, and 127.0.0.1 does not resolve localhost.

That's the main problem why extension isn't worked on Windows VS code.

I don't know the extension source code because it runs with the binary.

If we run this extension on Linux VS code, it's worked successfully because it can connect and run server on 127.0.0.1:8000.

2019-01-21 17-31-22

And the process will present the following screenshot picture via ps command:

2019-01-21 17-35-07

peter279k commented 5 years ago

To @ziishaned, please consider the following suggestions:

ziishaned commented 5 years ago

@peter279k In the next release, I will make it configurable so that user can configure on which host he wants to start the server

peter279k commented 5 years ago

@ziishaned, thank you for your reply.

It's very nice to let users set the customized URL.

I appreciate your help. Once the latest extension is released, I can help you to test the extension on Windows and Linux Ubuntu 16.04 👍 .

Karimaljandali commented 5 years ago

Thanks for your help @peter279k and @ziishaned I would love to get this up and running, looking forward to the next release.

martinandersen3d commented 4 years ago

What is the status of the windows fix? :) @ziishaned if you need a windows machine, I can help you with that..