Wednesday, March 4, 2020

s3cmd error : /usr/bin/env: ‘python2’: No such file or directory

 Solution :
It is not able to find /usr/bin/python2 or /usr/bin/python with python2.x
To solve this install the package in debian based systems like Ubuntu.

sudo apt-get install python-minimal

Wednesday, February 5, 2020

Apache Mixed Content Error

Mixed Content is the most common issue in an apache website. The perfect solution is, you need to find all urls and replace http with https but it may be time consuming and most probably this solution is at developer's end.
If you want to fix it at apache's end, here is the solution. Atleast you should give a try.

First enable module headers in apache

sudo a2enmod headers
sudo service apache2 reload

Now add the line in virtualhost, your 443 port virtualhost where you have defined ssl keys. People add it in 80 port virtual host and complains it does not work.
Header always set Content-Security-Policy "upgrade-insecure-requests;
If you do not have virtualhost access, add the line in .htaccess
Header always set Content-Security-Policy "upgrade-insecure-requests;
Now check the urls in updated version of firefox / chrome / your browser.

If you get internal server error, it means header module is not enabled.

Magento bccomp Error

[Fri Jan 17 11:51:13.302280 2020] [php7:error] [pid 2430] [client 172.17.0.1:44334] PHP Fatal error:  Uncaught Error: Call to undefined function Magento\\InventorySales\\Model\\IsProductSalableForRequestedQtyCondition\\bccomp() in vendor/magento/module-inventory-sales/Model/IsProductSalableForRequestedQtyCondition/IsSalableWithReservationsCondition.php

Solution :

Install php bcmath package and restart apache.
sudo apt-get install php-bcmath
The solution is for apache installed on Ubuntu. If you have installed php using different command like sudo apt-get install php7.0 or sudo apt-get install php7.2 or sudo apt-get install php5.6, you need to install the package using similar method i.e. sudo apt-get install php7.0-bcmath or sudo apt-get install php7.2-bcmath or sudo apt-get install php5.6-bcmath etc.