chore: downgraded PHP from version 8 to version 7.4 for better compatibility

This commit is contained in:
Junior L. Botelho (JLB) 2023-02-12 13:39:32 -03:00
parent 449ec0dd7a
commit c1c401a5f9
No known key found for this signature in database
GPG Key ID: 6A25840754F2A524
4 changed files with 11 additions and 11 deletions

View File

@ -5,7 +5,7 @@
sh "docker/php/prepare.sh"
sh "docker/server/prepare.sh"
service php-fpm8 start
service php-fpm7 start
service nginx start
exec nginx -g "daemon off;"

View File

@ -1,5 +1,5 @@
# Set this argument during build time to indicate that the path is for php's www.conf
ARG WWW_CONFIG="/etc/php8/php-fpm.d/www.conf"
ARG WWW_CONFIG="/etc/php7/php-fpm.d/www.conf"
# Configure 'opensearch.xml' with Librex configuration metadata, such as the encoding and the host that stores the site
# These configurations will replace the 'opensearch.xml' inside '.dockers/templates' for the best setup for your instance
@ -49,8 +49,8 @@ ENV CURLOPT_VERBOSE=false
# Install PHP-FPM using Alpine's package manager, apk
# Configure PHP-FPM to listen on a Unix socket instead of a TCP port, which is more secure and efficient
RUN apk add php8 php8-fpm php8-dom php8-curl php8-xml --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing &&\
sed -i 's/^\s*listen = 127.0.0.1:9000/listen = \/run\/php8\/php-fpm8.sock/' ${WWW_CONFIG} &&\
RUN apk add php7 php7-fpm php7-dom php7-curl php7-json php7-xml --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing &&\
sed -i 's/^\s*listen = 127.0.0.1:9000/listen = \/run\/php7\/php-fpm7.sock/' ${WWW_CONFIG} &&\
sed -i 's/^\s*;\s*listen.owner = nobody/listen.owner = nginx/' ${WWW_CONFIG} &&\
sed -i 's/^\s*;\s*listen.group = nobody/listen.group = nginx/' ${WWW_CONFIG} &&\
sed -i 's/^\s*;\s*listen.mode = 0660/listen.mode = 0660/' ${WWW_CONFIG}

View File

@ -10,7 +10,7 @@ server {
}
location ~ \.php$ {
fastcgi_pass unix:/run/php8/php-fpm8.sock;
fastcgi_pass unix:/run/php7/php-fpm7.sock;
fastcgi_index index.php;
include fastcgi.conf;
}

View File

@ -5,13 +5,13 @@ echo "[PREPARE] docker/server/prepare.sh'"
# Load all environment variables from 'attributes.sh' using the command 'source /path/attributes.sh'
source "docker/attributes.sh"
# This condition creates the Unix socket if 'php-fpm8.sock' does not already exist.
# This condition creates the Unix socket if 'php-fpm7.sock' does not already exist.
# This fixes an issue where Nginx starts but does not serve content
if [ ! -d "/run/php8" ] || [ ! -S "/run/php8/php-fpm8.sock" ]; then
mkdir "/run/php8"
touch "/run/php8/php-fpm8.sock"
chmod 0660 "/run/php8/php-fpm8.sock"
chown nginx:nginx "/run/php8/php-fpm8.sock"
if [ ! -d "/run/php7" ] || [ ! -S "/run/php7/php-fpm7.sock" ]; then
mkdir "/run/php7"
touch "/run/php7/php-fpm7.sock"
chmod 0660 "/run/php7/php-fpm7.sock"
chown nginx:nginx "/run/php7/php-fpm7.sock"
fi
export OPEN_SEARCH_HOST_FOR_NGINX="$(echo "${OPEN_SEARCH_HOST}" | cut -d "/" -f 3 | cut -d ":" -f 1)"