Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DietPi-Software | Redis: Minor un/installation/activation fixes of PHP module #1249

Merged
merged 2 commits into from
Nov 22, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -3795,6 +3795,12 @@ _EOF_

Banner_Installing
AGI redis-server
#Redis php module | == 2 to check for existing installs, if == 1, then module will be installed together with PHP, to prevent dependency installations
if (( ${aSOFTWARE_INSTALL_STATE[89]} == 2 )); then
Copy link
Collaborator

@Fourdee Fourdee Nov 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will only be true, if dietpi-software has previously installed 89 and rebooted.
=2 is not set until the very end of dietpi-software installs:
https://github.com/Fourdee/DietPi/blob/testing/dietpi/dietpi-software#L14286-L14296

=1 during installations, =2 set at the very end.

Is this by intention?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is okay: if redis and php were chosen to install together, php part includes installation of php(5)-redis anyway.

This was just necessary, if php was already installed before and you somehow chose to install redis-server later, e.g. you read about advantages with ownCloud/Nextcloud 😉.

The problem with using ">=1" is, as I tried to explain in code, that redis-server package installation is done before PHP, and as php-redis depends on php packages, it will install them and in case choose some random optional dependency (libapache-mod-php / php-fpm / php-cgi e.g.): https://packages.debian.org/stretch/php-redis

We could switch positions of redis and php installation as another solution. Generally there would be the same problem then with php-redis' server dependency, but redis-server is so far just suggestion, not dependency: https://packages.debian.org/jessie/php5-redis

Long story short: On choosing redis (==1), it will install the module, if php==2 and if php==1 then php loop will see redis==1 and take care it's module installation.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MichaIng

Thanks , understood 👍

I'll get this merged.


AGI "$PHP_APT_PACKAGE_NAME"-redis

fi

fi

Expand Down Expand Up @@ -8978,9 +8984,8 @@ _EOF_
INSTALLING_INDEX=91
if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then

#Enable resdis extensions for all webstacks:
echo -e "extension=redis.so" > "$FP_PHP_BASE_DIR"/cli/conf.d/20-redis.ini &> /dev/null
echo -e "extension=redis.so" > "$FP_PHP_BASE_DIR"/apache2/conf.d/20-redis.ini &> /dev/null
#Enable redis extension for all webstacks:
"$PHP_APT_PACKAGE_NAME"enmod redis

fi

Expand Down Expand Up @@ -13052,7 +13057,7 @@ _EOF_

elif (( $1 == 91 )); then

AGP redis-server
AGP redis-server "$PHP_APT_PACKAGE_NAME"-redis

elif (( $1 == 89 )); then

Expand Down