Downgrade PHP version on Lightsail LAMP

Keywords: LAMP/MAMP/WAMP - AWS - Technical issue - Other
Description:
Hello team,

I’m running Prestashop on a Lightsail instance, in your LAMP environment. Unfortunatly, Prestashop (1.7.7.2) requires PHP 7.3, and the version that comes with LAMP is 7.4, which leads to some issues.

I followed your advice in another topic (https://community.bitnami.com/t/downgrading-php-version-from-7-3-6-to-7-1/69053/2?u=c.codin):

  1. I renamed /opt/bitnami into /opt/bitnami_save (instead of removing it)
  2. I typed the command:
curl -LJO "https://downloads.bitnami.com/files/stacks/lampstack/7.3.27-0/bitnami-lampstack-7.3.27-0-linux-x64-installer.run"
chmod +x ./bitnami-lampstack-7.3.27-0-linux-x64-installer.run
sudo ./bitnami-lampstack-7.3.27-0-linux-x64-installer.run --prefix /opt/bitnami

I get the ‘7.3.27-0’ from your changelog.

During the install I selected no for all the optional (I guess) modules, like Zend Framework, Varnish…)

The installation is done properly BUT: I dont see php-fpm when I run ’ sudo /opt/bitnami/ctlscript.sh status and gonit is not installed at all ( /opt/bitnami/gonit` does not exist).

Could you explain to me how to have php-fpm and goni back please ?

Thank you

Hello @c.codin,

You would need to install lamp enabling php-fpm as an option for the installer. To have the same configuration as the one used by the instance please try using the following options:

sudo ./bitnami-lampstack-7.3.27-0-linux-x64-installer.run --prefix /opt/bitnami --apache_server_port 80 --mysql_port 3306 --apache_mpm_mode event --enable_phpfpm 1 --enable_pagespeed 1

Regarding gonit, it is already installed by default and it is configured to automatically detect Apache’s configuration so it should work if you delete /opt/bitnami. You can find more information about gonit in our Configure And Use Gonit guide.

Regards,
Francisco de Paz

1 Like

Hi @fdepaz,

Thank you, I will try this.
Could you tell me where can I find the command options you just used ?

Regards,

I mean the docs for command options*

Hello @c.codin,

Most of the options are documented in the installer’s --help but the are indeed some that are not present there (but they are still valid). We have guides on how to enable both php-fpm and pagespeed, and the installer performs similar actions to the ones documented there automatically.

Regards,
Francisco de Paz

1 Like

Hello @fdepaz,

I deleted the /opt/bitnami folder before launching the runner as you said but gonit is still not installed. Maybe I should remove it from the PATH too ?

In fact I saw gonit on your github repo, I will download it and reconfigure it from scratch. I think this may be the simplest solution.

Hello @c.codin,

Given you are using --prefix /opt/bitnami as an option with the installer, you shouldn’t need to remove anything from the PATH. Regarding gonit, itis strange that it is not present already in the machine. Please share with us any issues that arise reconfiguring your instance.

Regards,
Francisco de Paz

Hello @fdepaz,

There was only a gonit and monit symlink in /usr/bin/ that pointed to /opt/bitnami/gonit/bin/gonit. Since the lamp installer .run does not reinstall gonit the binary was never found.

After having cloned your gonit repo (and make install etc…), I moved the built gonit to /opt/bitnami/gonit/bin/gonit. Next I reconfigured the all the .conf in /etc/monit/conf.d to match the Approach B since it was preconfigured with the Approach A (I use the LAMP LightSail instance).

For those who don’t know what to type in their .conf, I think you can copy / paste the config defined here: /opt/bitnami/config/monit/conf.d/

Then I did a gonit reload and all my services were monitored :slight_smile:

So I think you can mark this subject as resolved.

Thank you for your support, really appreciated.

1 Like