Can you recommend a good LAMP working environment? i.e. Frameworks, Libraries

Hi, I am getting back into programming again after a long hiatus.

I am working on a personal website that will sell music.

Previously I was making websites from scratch using LAMP stack and maybe occasional use of JQuery. I am basically a beginner.

The most ambitious website I created was a shopping website selling limited items, only a few pages and every page was written from scratch copying code from other pages and repeating them on every page (all the design elements and formatting).

Can anyone recommend a good library or Framework, without a long learning curve, to aid me in my development? I just want to avoid having to repeat design elements on multiple pages and be able to modify the look/‘theme’ of my website from a central place.

It is not for an enterprise, just a small business and I will be the only coder.

Honestly I would say try to learn Docker. You can spin up a Docker container that has all the necessary stuff you need such as the full LAMP stack without the need to go into fully installing things yourself. They have Docker images for that. You can also use Docker as an opportunity for job interviews. Majority of companies are using Docker at this point. I know my work place uses this heavily with AWS.

1 Like

Thank you for the suggestion. I’ll take a look at it.

Why do you want to code this yourself? Just use web building apps like Wordpress or Joomla.
That way you no even need an own server. You can just rent a cheap hosting and that’s it.

For me it looks like you are overcomplicating things…

1 Like

It seems like when you want a very specific look or behavior, it’s much harder to use these systems. I never tried Wordpress or Joomla, but I’ve tried Drupal and that was more trouble than it was worth as far as trying to learn it and making it look and behave the way you want.

Meh! I’m not really sure I agree with that. Docker, while useful for managing environments and deployments, doesn’t directly address the main concern of managing website themes and avoiding repetitive code across pages. Additionally, Docker can be quite a challenge for beginners. The learning curve involves understanding containerization, Docker commands, and Dockerfiles, which might be a bit overwhelming.

@Nora1234: for your needs, a web framework that supports component-based design and easy theme management would be more beneficial. You might want to look at a framework like React or Vue.js. These allow you to build your website with reusable components, meaning you don’t have to repeat your design elements on multiple pages.

Or, if it’s just a case of including say a nav bar on multiple pages and not wanting to repeat the code, you can do this in regular PHP. You would create a nav.php file with the navbar markup and then wherever you want to use it in another PHP file, you can just do:

<?php require '/nav.php'; ?>

Apologies if you knew that already :slight_smile:

This is also a good idea. WordPress is very customizable and nothing like Drupal in terms of how complicated it is. The bar to getting started and to making your own theme is really very low and there are plugins for almost any use case imaginable.

It seems every time I encounter a Wordpress site, it’s identified as such and they a have a very particular look. I didn’t know it was that customizable. I’ll have to look into that.

I heard of React, I’ll have to look into that as well.

Pretty sure I did not use this PHP method w the Nav bar. I don’t remember half of what I used to. I’ll have to look at some old projects again.

Thank you for the feedback I really appreciate it.

Well you don’t necessarily have to use Dockerfiles. If you want to just run something quickly, you can always just pull the image and create your container. It’s the same thing as running LAMP on anything like Vagrant or on actual Linux machines, etc. There’s going to be any kind of learning curve regardless what solution you go with.

If you’re starting new now I would certainly go with Docker. Vagrant and the like are pretty much obsolete at this point, imo.

Not too sure what you guys are discussing regarding Docker - Are you talking about setting up the server?

In the past, as far as setting up my server with Apache - the hosting service used to take care of everything. I think I used to use a shared hosting service with a company called Inmotion Hosting and the server was set up with Apache and everything was ready to go.

It is to set up a local server environment for development, before you upload to your host’s server.
This is the correct way of doing things as you won’t be interfering with a live site while things are at the development stage, or when making subsequent changes to the site. Keep it all local until you get it right, then upload when everything works as intended.

The way James shows is how I initially did things when I first started out using PHP. But now I prefer to do it differently.
I will have one single whole page template that contains (or includes) all the elements that are common to all pages. Then the include is just the content of the page which is unique to itself.
I find this way much more DRY, otherwise you end up with a whole lot of pages that all contain the same includes repeated page after page. Then if you ever want to edit or restructure the page, you have to repeat those changes on all your pages.
If you only have a single page template, you only do it once.

So the template may contain things like:-

<title><?= $title; ?></title>
<meta name="description" content="<?= $description; ?>">

in the head, and in the body:-

<header>
   <h1><?= $title; ?></h1>
   <?php require '/nav.php'; ?>
</header>
<main>
   <?php require $pageCont; ?>
</main>

Though you may end up going with a template engine, which will be similar, but not exactly the same.

But it is still far more easy to setup the lamp stack with just starting the installer, then working with docker containers. And local is local. You do not need to wrap your lamp stack in a docker to be more local.

I wasn’t specifically referring to Docker here, it was more conveying the point that it’s a good idea to set up a local envionment for development, rather than work directly on a live server.
How to set up that local server, well that’s part of the question.
Personally I do use Docker for this now. But I would agree with James that it is a steep learning curve for a beginner. I have heard many say that Docker is so simple to set up and use, but I think these are mainly people who already have a background in how to install, set-up and configure a server. Compared to that it probably is simple, but if you don’t have that background it can be confusing and difficult.
As someone who previously used WAMP for local development, I found it difficult to get started with Docker. It’s not so hard once you have some working set ups you can duplicate and adapt to new projects, but I still sometimes struggle when I want to do something different. Like many things, it’s easy when you know how.
I found WAMP very easy to set up, but it was just too limited and restrictive in what I was able to do with it.

If you are on Windows, the best and easiest local dev would be to install Laragon.

1 Like

Ah the proper way to do things… I didn’t know anything about that.

The site was for a small soap company and at the time didn’t have many customers. I think I might have tested any updates in a subdirectory hoping nobody stumbles upon it.

Thank you for the suggestion.

I’ll check it out.

WordPress has a lot lower learning curve than Drupal. Also WordPress comes with Gutenberg now which allows you to create/modify frontend design in a GUI. And if you don’t like that then there are other page builders available for WordPress like Elementor, Divi etc.

Such as?

Here are 4 sites:

They all use WordPress and all look different. :slight_smile:

If you are going to sell things from your website, then you will need a backend as well. Just frontend with HTML + CSS (+ React/Vue/Svelte) won’t do unless you are going to use a 3rd party service to handle payments and downloads.

If you want to build the backend to handle payments & downloads then a good quick option for you would be to use an existing solution. Two popular choices would be

  • Shopify - its a hosted platform where you can run an ecommerce store and sell things. Customization is possible but only to frontend via pre-made or custom themes.
  • WooCommerce - this is a WordPress plugin which turns your WordPress install into an ecommerce store. You can have a hosted solution in this or you can host it yourself where you can have complete control.

If you don’t want to use an pre-made solution & want to make your own then I would suggest using Laravel. It is a full stack framework & has a lot of community support along with a bunch of first party support to quickly build stuff. It also has 4 different options of setting up a local dev environment

  • Laravel Homestead - this is a vagrant based local dev environment. Its easy to setup & gets you up & running with all the tools you will need to build your Laravel app. This is only for x86 processor based computers. To make it work on ARM chipsets (like Apple Silicon) you will need to get a paid license of Parallels & use that instead of VirtualBox.
  • Laravel Sail - this is a docker based local dev environment. Its easy to setup as well. This works on both x86 & ARM chipsets.
  • Laravel Valet - this sets up a local dev environment on your OS itself without any VM or container. This is macOS only.
  • Laravel Herd - this sets up a local dev environment on your OS itself. Its available for macOS & Windows.

With Laravel you can choose to have your frontend in React or Vue or you can just go with plain HTML. If you want to go with React or Vue then look into Inertia.js & install Laravel with it to make your life easier.

1 Like

Such as?

That observation was made during the early years of Wordpress. Many of the sites looked very similar, maybe because the developers used a default template.

I see it’s very customizable now.

Thank you very much for your suggestions of Laravel and other suggestions. Very good to know - I like the idea of being able to control every detail.

If your goal is only to sell your goods, then you do not need to develop. It is a waste of time unless you have a logical reason or a strong personal desire to code. I’d use a hosted and managed cart like Shopify.

Also, you do not need wordpress or woocommerce… there are plenty of open source carts specifically made for the shopping experience and optimized for such.

After all, why waste your time coding when you can be marketing?