Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

VSCode, Liveserver and Chrome

1,380 views
Skip to first unread message

Call Me Tom

unread,
Aug 7, 2019, 1:18:28 AM8/7/19
to
I'm using VS Code for creating my PHP files. I'm trying to get
liveserver to work with PHP files.It works fine with an HTML file. I
have installed the live server extension in chrome and the live reload
button is on. When I go live in VSC all I get in Chrome is a
directory listing. I am using a default XAMPP installation.

What is the actual server address that should be entered in Chrome?
Any other suggestions would be appreciated.

Paul Herber

unread,
Aug 7, 2019, 11:34:58 AM8/7/19
to
Liveserver doesn't seem to have a PHP processor built-in. What is wrong with using
Apache/PHP etc?



--
Regards, Paul Herber
http://www.paulherber.co.uk/

Call Me Tom

unread,
Aug 7, 2019, 1:18:57 PM8/7/19
to
On Wed, 07 Aug 2019 16:34:53 +0100, Paul Herber <pa...@pherber.com>
wrote:
If you read the message you would see that I am using XAMPP for the
PHP server.

Lew Pitcher

unread,
Aug 14, 2019, 6:04:37 PM8/14/19
to
Apparently, some variation of http://localhost/ or http://127.0.0.1/

At least, according to the XAMPP FAQ


--
Lew Pitcher
"In Skills, We Trust"

Call Me Tom

unread,
Aug 18, 2019, 7:43:50 PM8/18/19
to
Thanks Lew. I tried both of those and all I get is a directory
listing.

Jerry Stuckle

unread,
Aug 18, 2019, 10:49:52 PM8/18/19
to
You get a directory listing if you just request a directory and do not
have a default home page (often index.html) in that directory.

This is an Apache configuration problem and has nothing to do with PHP.

--
==================
Remove the "x" from my email address
Jerry Stuckle
jstu...@attglobal.net
==================

J.O. Aho

unread,
Aug 19, 2019, 12:53:54 AM8/19/19
to
On 19/08/2019 04.49, Jerry Stuckle wrote:
> On 8/18/2019 7:43 PM, Call Me Tom wrote:
>>   <lew.p...@digitalfreehold.ca> wrote:
>>
>>> Call Me Tom wrote:
>>>
>>>> I'm using VS Code for creating my PHP files.  I'm trying to get
>>>> liveserver to work with PHP files.It works fine with an HTML file.  I
>>>> have installed the live server extension in chrome and the live reload
>>>> button is on.  When I go live in VSC all I get in Chrome is a
>>>> directory listing. I am using a default XAMPP installation.

First of all, I'm not a XAMPP user, I prefer a OS that comes with simple
install all php/mariadb/apache.

>>>> What is the actual server address that should be entered in Chrome?
>>>> Any other suggestions would be appreciated.
>>>
>>> Apparently, some variation of http://localhost/ or http://127.0.0.1/
>>>
>>> At least, according to the XAMPP FAQ
>>
>> Thanks Lew.  I tried both of those and all I get is a directory
>> listing.
>>
>
> You get a directory listing if you just request a directory and do not
> have a default home page (often index.html) in that directory.

At least in the world most used OS, apache comes with a default
configuration which enables index.php as a default page if the php
module is loaded (-D PHP).


> This is an Apache configuration problem and has nothing to do with PHP.

Could be that the OP just don't have a index.php but say default.php as
the starting point of his site in which case the error should be between
the keyboard and the chair.

--

//Aho

Call Me Tom

unread,
Aug 19, 2019, 2:26:37 PM8/19/19
to
On Mon, 19 Aug 2019 06:53:48 +0200, "J.O. Aho" <us...@example.net>
wrote:
Yes, I have alll these things. I can run PHP directly from the
browser and I also run without any problems from Netbeans. It's Live
Server that I couldn't get running in Visual Studio Code.

I posted here because I thought one of the mnany PHP programmers here
might use VSCode as their IDE and could give me a little help with
Live Server. Because this does not seem to be the case, I will
continue with Netbeans. Thanks for trying to help.



I posted here

Lew Pitcher

unread,
Aug 19, 2019, 3:03:16 PM8/19/19
to
From the FAQ (at https://www.apachefriends.org/faq_windows.html)

Where should I place my web content?

The main directory for all WWW documents is \xampp\htdocs. If you put a
file "test.html" in this directory, you can access it with the URI
"http://localhost/test.html".

And "test.php"? Just use "http://localhost/test.php". A simple
testscript can be:

<?php echo 'Hello world'; ?>

A new subdirectory for your web? Just make a new directory (e.g. "new")
inside the directory "\xampp\htdocs" (best without whitespaces and only
ASCII), create a test file in this directory and access it with
"http://localhost/new/test.php".


HTH

Lew Pitcher

unread,
Aug 19, 2019, 3:10:25 PM8/19/19
to
See other post.
Plus, you might also look at the faq question

"What are "Automatic start pages" for the WWW directories?"
The standard filename for the Apache function "DirectoryIndex" is
"index.html" or "index.php". Every time you are just browsing to a
folder (e.g. "http://localhost/xampp/"), and Apache can find such a
file, Apache is displaying this file instead of a directory listing.

Note that last line

HTH

Ozed machina

unread,
Jun 1, 2022, 6:43:02 AM6/1/22
to
Were you able to get this working?

J.O. Aho

unread,
Jun 1, 2022, 8:26:18 AM6/1/22
to
For issues with Live Stream visit:
https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer

For issue with Apache config ask your question at:
alt.apache.configuration

--

//Aho
0 new messages