Jump to content

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


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:

image.thumb.png.866264a5674585a162e6dd22901d3c2c.png

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)

(1)
 

    private function buildShopConstraintFromContext(): ShopConstraint
    {
        @trigger_error(
            'Not specifying the optional ShopConstraint parameter is deprecated since version 1.7.8.0',
            E_USER_DEPRECATED
        );
...

(2)

    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

ENV PS_DEV_MODE=1

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 \
        libonig-dev
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 \
    /var/www/html/img

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

EXPOSE 80

 

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...