WhitewaterFoundry / Pengwin

A Linux distro optimized for WSL based on Debian.
Other
1.48k stars 105 forks source link

Add PHP installation options for each PHP version and common packages #554

Open valorin opened 4 years ago

valorin commented 4 years ago

Is your feature request related to a problem? Please describe.

Since Penwgin is based off Debian, it's default version of PHP is incredibly old, and you're limited to installing the provided version. It would be fantastic if pengwin-setup could provide an option to install PHP, with each of the supported versions (https://www.php.net/supported-versions.php). Currently the solution is to install from the testing repo (still version limited), or install and configure a third-party repository with the latest versions.

While this isn't tricky, you need to know what third-party repository to use and how to install it. I found https://packages.sury.org/php/ and installed it with the instructions at https://packages.sury.org/php/README.txt, however the Debian testing repos were given priority in sudo apt-cache policy, which took some effort to figure out how to override.

Describe the solution you'd like

  1. Run pengwin-setup
  2. Select Programming
  3. Select PHP
  4. Select one or more PHP versions to install, with 7.2, 7.3, 7.4 available.

The installer should then configure the repository and apt-cache policy, and then install PHP. The common packages I always have installed are (If there are any other PHP developers around, it'd be good to check with them what they need too):

php7.3-bcmath php7.3-cli php7.3-curl php7.3-gd php7.3-imagick php7.3-intl php7.3-json php7.3-mbstring php7.3-readline php7.3-sqlite3 php7.3-xsl php7.3-zip

(replacing 7.3 with whatever versions are requested)

It could be good to optionally install some these too, if their matching services are installed: php7.3-fpm, php7.3-mysql, php-redis, etc.

Describe alternatives you've considered

The installation steps could give the users the options for which packages to install, as well as which versions, although that does add some complexity to the installation process. So having common packages installed automatically would keep it simpler.

Additional context

Note that installing PHP on it's own (as sudo apt install php7.4) usually triggers installation of Apache, which not everyone wants to use. So it's best to go for php*-cli and optionally add the webserver modules on as needed.

xmarkclx commented 4 years ago

There's already an option to install a LAMP stack though.

valorin commented 4 years ago

The thing is, I don't use the LAMP stack. PHP comes with it's own development server, so you have no need for Apache. When I need something with more control, I use Nginx instead of Apache. If I'm using the PHP dev server, Also I'll typically use SQLite instead of MySQL/MariaDB, as it's lightweight.

The LAMP stack also doesn't give the option to select what PHP versions of PHP to install. This is the mort important bit for me.

As I explained in the start of my request, there are a few steps required to getting the right PHP repository installed, so all of the versions can be easily installed. It seems to me that this sort of setup is exactly the sort of thing pengwin-setup is trying to make easier for the user. LAMP is a single opinionated stack that doesn't meet that need at all.

crramirez commented 4 years ago

We can give the same options as we do for python and node.