Jump to content

Unable to install with error during Post Install Scripts: "...ShopConstraint parameter is deprecated since versions"

Recommended Posts

Hi all,

I'm trying to install PrestaShop 8.1.0 from source after downloading the release and moving the source code to my Linux based VM. I built a Dockerfile to containerize everything based on the official Dockerfiles in the PrestaShop Docker repo and some examples I found online to help get me started (will put it below, as it could be a configuration issue).

This is the error I'm getting:


I see no place to set the ShopConstraint and I'm not sure this is an ENV I set during containerization or if I need to just add a ShopConstraint somewhere in the code itself. Since I can't get passed this it's currently making me unable to actually do anything and start playing around with PrestaShop to do what I need to with my organization. It's throwing an error on this (1)  line in that file, presumably called from (2)


    private function buildShopConstraintFromContext(): ShopConstraint
            'Not specifying the optional ShopConstraint parameter is deprecated since version',


    public function has($key, ShopConstraint $shopConstraint = null)
        if (null === $shopConstraint) {
            $shopConstraint = $this->buildShopConstraintFromContext();

or it's equivalent get/set.

Any ideas?

Here is the Dockerfile I'm using:

FROM php:7.4-apache


WORKDIR /var/www/html
# update packages
RUN apt-get update
# install zip and pdo extensions
RUN apt-get install -y libmcrypt-dev \
        libjpeg62-turbo-dev \
        libpcre3-dev \
        libpng-dev \
        libwebp-dev \
        libfreetype6-dev \
        libxml2-dev \
        libicu-dev \
        libzip-dev \
        default-mysql-client \
        wget \
        unzip \
RUN rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-configure zip \
    && docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ --with-webp=/usr/include
RUN docker-php-ext-install zip pdo pdo_mysql mysqli mbstring soap gd zip bcmath

# install gd image library
RUN apt-get install -y \
        libfreetype6-dev \
        libjpeg62-turbo-dev \
        libpng-dev \
    && docker-php-ext-configure gd --with-freetype --with-jpeg \
  && docker-php-ext-install -j "$(nproc)" gd

# install intl extension
RUN apt-get install -y zlib1g-dev libicu-dev g++ \
    && docker-php-ext-configure intl \
    && docker-php-ext-install intl

# enable mod_rewrite
RUN a2enmod rewrite

# install opcache for php acceleration
RUN docker-php-ext-install opcache \
    && docker-php-ext-enable opcache \
    && rm -rf /var/lib/apt/lists/* \
    && apt-get autoremove -y

# install database
RUN apt-get update
RUN apt-get install -y mariadb-server

# create user-psuser password-admin and assign privileges
RUN service mariadb start \
    && mysql -uroot mysql -e "CREATE USER 'psuser'@localhost IDENTIFIED BY 'admin';GRANT ALL PRIVILEGES ON *.* TO 'psuser'@localhost IDENTIFIED BY 'admin';FLUSH PRIVILEGES;"

# copy prestashop folder content
COPY prestashop-8.1.0/ /var/www/html/
COPY phppsinfo.php /var/www/html/

# Change owner and permissions
# RUN chown -R www-data:www-data /var/www/html/var/logs
RUN chmod -R 0777 /var/www/html/var/logs \
    /var/www/html/var/cache \
    /var/www/html/config \
    /var/www/html/img \
    /var/www/html/mails \
    /var/www/html/modules \
    /var/www/html/translations \
    /var/www/html/upload \
    /var/www/html/download \
    /var/www/html/app/config \
    /var/www/html/translations \
    /var/www/html/app/Resources \

COPY user_config/php.ini /usr/local/etc/php/



Current PHP version: 7.4.33. Attempted with php 8.1 as well.
I've tried to install PS 8.1.1 and 8.1.0

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...