Live server configuration for Contao (index.php)

A question about the configuration of the Atom Live server.

I am developing a local project with the content management system “Contao”. It is important for Contao that the domain points to the folder /web, which is created in the root directory. There is an index.php in it.

But when I start the live server, I always see the file system of the CMS and not the frontend of the website.

I tried the one in the .atom-live-server.json with the entry:

{
“entry-file”: “web/index.php”
}

But I guess that’s wrong. Sorry, I’m not familiar with server configurations, but I’d like to use the Live Relaod function when developing Contao projects.

My suggestion is that you opt for installing php-server.

apm install php-server

It is very useful not only for PHP development but in general because of its reporting and preview features.

Okay, I installed the php-server.

In my Windows hosts file I registered my local domain:
127.0.0.1 domain.local

In the php-server settings I entered domain.local as hostname.

When I now start the php-server, the port is appended to the domain (domain.local:8000) and the page is not displayed. If I remove the port, it works. But only because I have an Apache server running over XAMPP in the background.

Is there a way to output domain.local:8000 without port?

Here are some first thoughts.

<?php
echo phpinfo();
?>

Incidentally, when in Atom you visit /web/index.php and right click on the file in tree-view there are two options seen …

PHP Server here
PHP Server route file

Try both of these in turn to see results.

And under Packages > PHP Server there are three further choices.

I use the right click method instead since it is quicker.

Thanks for the link. I think when I work through the tutorial I understand things a bit better.

After all, my website is now displayed when I right-click /web/index.php and select “PHP Server here”.
The path in the browser will look like this: http://localhost:8001/index.php/index.html.html

However, php-server does not support live reload, as I suspect.

That path does not look correct at all I’m afraid. I am using Laravel as my PHP development framework. I did take a peep at Contao but the English documentation is work in progress. My vote would be Laravel and tutorials in Laracast.

Many thanks d_l. I think I’ll try my luck with a other editor.