Why you shouldn't use PHP + MySql + Apache bundles

2019 May 21 at 02:31 » Tagged as :mysql, php, apache,

Ancient history.

These bundles are known by many different names like XAMPP, WAMPP, LAMPP etc. They all have a few things in common, such as  PHP, MySql and Apache being bundle installer togther with a bunch of other stuff like Wordpress, Joomla and phpmyadmin. Sometimes Apache makes way for nginx. These bundles were very popular a decade ago and sadly even today they are used far more often than they should be. These were and still are primarily used by developers on their desktops. The reason for their popularity was the fact that one does not need to seperately install any of the servers but instead they are all installed with reasonable defaults.

All these bundles are obsolete now rather they became obsolete as far back march 2012.

PHP Development server.

When php 5.4 was released in 2012, it completely eleminated the need to setup apache for development enviorenments. This is thanks to the inclusion of a PHP built in webserver. Since then all that was needed to test your scripts locally was to enter the terminal, move into the folder with the scripts and just type

php -S localhost:8000

And the built in webserver would immidiately start to deliver your files. You can view them in the browser just as you would with apache.

What about mysql?

Exactly! What about mysql? First of all do you really need mysql? Don't be put off by the lite in sqlite. It's a fantastic database and it's perfectly capable of powering almost all the websites out there. Let's admit it almost all the websites out there including this one get's very little traffic. A vast majority of the page views on almost any website doesn't result in a database write operation. Sqlite may suck at write operations but it handles read operations really well. So whenever possible switch to sqlite and do away with all that hassle.

On the other hand if you really do need to use mysql, it's fairly straightforward to install the server from the downloads available for your operating system on the mysql website. Alternatively you could install mariadb or percona server.

Using this approach helps to avoid having too many black boxes in your system. Often while working with mentees i've had to ask where are your errors logs? Where is the php.ini file why are you not using a debugger and an IDE and often they didn't have an answer due to the fact they had used a bundle. And these bundles make it very hard to customize each installation to meet your requirements + updating individual paakges are a nightmare.