Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

howi's avatar
Level 6

Indispensable php modules

I was using XAMPP, but I switched to a local LAMP server. I mean that I installed apache2, mariadb and php. My system is Linuxmint.

Now that I can istall PHP modules with apt, I was wondering which are the modules that are indispensable.

I found some requisites on the Laravel websites, so I did:

apt install php-pdo php-mbstring php-tokenizer php-xml php-ctype php-json php-bcmath

As I also installed phpmyadmin, there are other modules I needed

apt install phpmyadmin php-cli php-cgi php-pear javascript-common php-curl php-gd php-bz2 php-zip php-tcpdf php-libsodium php-gmp php-imagick

I guess I will install something else in future (I am thinking to some Laravel extensions) and I was wondering if there are any php modules that is essential.

Thank you

0 likes
13 replies
D9705996's avatar

There isn't a definitive list of packages/extensions you will need as this depends on what you are building. However if you installing packages via composer you will, usually find they include the necessary dependencies in composer.json e.g. for laravel

"require": {
        "php": "^7.1.3",
        "ext-mbstring": "*",
        "ext-openssl": "*",

Even if the package codsnt have these constraints they will normally be included in the installation instructions.

howi's avatar
Level 6

That's great for a single app, but I'd like to have a list of packages to install with apt to build a complete LAMP server. I've just switched from XAMPP and I had (almost) all the things already installed there. Now, instead, I have some problems: I've just installed a "laravel new blog" application, created a database, made migration and also given the command "php artisan make:auth" to build the authorization scaffolding. Artisan said:

$ php artisan migrate
Migration table created successfully.
Migrating: 2014_10_12_000000_create_users_table
Migrated:  2014_10_12_000000_create_users_table
Migrating: 2014_10_12_100000_create_password_resets_table
Migrated:  2014_10_12_100000_create_password_resets_table
$ php artisan make:auth
Authentication scaffolding generated successfully.

I can see the welcome page, but when I click on Register, I get The requested URL /register was not found on this server.

So, as I've just built my LAMP, I'm thinking to some lack among my php-* packages.

howi's avatar
Level 6

Thank you very much.

But now let's go party.

Merry merry Xmas and see you next. ;D

Bye.

Zenith2012's avatar

If it's an option to you consider forge. Build a ubuntu server, run the command given on the forge website and your server is commissioned automatically and ready to host content.

It's not free, but I'm getting on great with it (thankfully I don't pay the bill although I don't think it's too expensive at all)

howi's avatar
Level 6

@d9705996 - You are right! When I installed apache I forgot to activate the rewrite module.

sudo a2enmod rewrite

I believe it's all working, now.

@zenith2012 - Thanks, but at the moment I'm just trying to get everything working locally. Next, when I will have learned enough and will have developed something great ( : ) ), I will look for a production server.

D9705996's avatar

@HOWI - Can you please mark the discussion as solved if your issue is fixed

howi's avatar
Level 6

I changed the title. Is that Ok?

Zenith2012's avatar

@HOWI - @howi I also use it for staging. I'm on windows and use (laragon)[https://laragon.org/] for local development with a forge staging server running ESX. It's really not too hard to setup and you can download and run ESX on most hardware, makes it easy peasy to run virtual servers (my staging server is running ubuntu as a virtual server on top of ESX).

Just something to consider when you're ready for that step. Obviously you could also go for digital ocean or someone simliar for your production server. I'm lucky enough that our organisation already rents colo space in a data centre in London so I can spin up a ubuntu server and link it to forge there for production use.

D9705996's avatar

@HOWI - Could you please select the best answer button in the top right of the appropriate answer (you need to click/hover over that answer to make the button appear ). You question will then show the best answer with a green background.

howi's avatar
Level 6

Well, the past days have been a little confused, but now I have tried my local website and guess what! I still have the same problem.

howi's avatar
Level 6

I can see my website, but when I click on register I get the error URL not found on this server.

The mod_rewrite is running

$ sudo a2enmod rewrite
Module rewrite already enabled

I tried with php artisan serve and the website is perfectly working, so it would be a problem with apache, but I have 3 other local websites and also phpMyAdmin that work. I enabled all the websites in the same way, so I think that the configuration file for the virtual server is correct.

I can't guess what could be the problem.

I added 127.0.0.1 blog.test in /etc/hosts.

This is my /etc/apache2/sites-available/blog.test.conf file

<VirtualHost 127.0.0.1:80>
    ServerName blog.test
    #ServerAlias www.blog.test
    ServerAdmin [email protected]
    DocumentRoot /var/www/blog/public
    #LogLevel info ssl:warn
    ErrorLog ${APACHE_LOG_DIR}/blog.test.error.log
    CustomLog ${APACHE_LOG_DIR}/blog.test.access.log combined
</VirtualHost>

and I enabled it

$ sudo a2ensite blog.test.conf 
[sudo] password di marco:          
Enabling site blog.test.
To activate the new configuration, you need to run:
  systemctl reload apache2
$ sudo systemctl reload apache2

The problem is still there.

What can I do?

howi's avatar
Level 6

I don't know if I can put this conversation back to the unsolved ones. Should I better open a new discussion?

Please or to participate in this conversation.