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 1 commit
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
Next Next commit
DietPi-Software | Redis: Minor un/installation and activation fixes o…
…f PHP module

- Auto installation of PHP module, if PHP stack is installed. Just do this, if PHP state is already installed+configured, otherwise this leads to dependency PHP installations. If PHP install state == 1, then redis module will be installed together with PHP already.
- Correctly use the phpenmod command to activate the PHP module. Otherwise this command will show errors later, I even got empty .ini files, leading to inactive module.
- Uninstall PHP module together with redis-server.
MichaIng authored Nov 21, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 8f180a95fe231b4421ba06d7b0cce06d4bb5e741
11 changes: 8 additions & 3 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
@@ -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

@@ -8979,8 +8985,7 @@ _EOF_
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
"$PHP_APT_PACKAGE_NAME"enmod redis

fi

@@ -13052,7 +13057,7 @@ _EOF_

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

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

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