From c8bbf00ca4d5eb6e01810bc6548696ef13c422fc Mon Sep 17 00:00:00 2001 From: Orestes Sanchez Benavente Date: Sat, 24 Jun 2023 23:38:03 +0200 Subject: [PATCH 1/4] Allow configuring php binary. --- phpenmod | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/phpenmod b/phpenmod index 00cf7c1..bfea647 100755 --- a/phpenmod +++ b/phpenmod @@ -262,9 +262,11 @@ dismod() { ################################################################################ SCRIPT_NAME=${0##*/} +PHP_BIN=${PHP_BIN:-php} + # check if php is installed # redirect stderr to stdout -OUT=`exec which php 2>&1` +OUT=`exec which $PHP_BIN 2>&1` if [[ -z "$OUT" ]]; then log "$OUT" log "PHP is not installed" RED @@ -272,7 +274,7 @@ if [[ -z "$OUT" ]]; then fi # read PHP parameters -PARAMS=`php -i | grep --color \ +PARAMS=`$PHP_BIN -i | grep --color \ -e "^extension_dir =>" \ -e "^Scan this dir for additional .ini files =>" \ ` From 131e68053f79cd5acdccfbea734a20159e9d30f2 Mon Sep 17 00:00:00 2001 From: Orestes Sanchez Benavente Date: Sat, 24 Jun 2023 23:39:11 +0200 Subject: [PATCH 2/4] Fix a typo on using SCAN variable. --- phpenmod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpenmod b/phpenmod index bfea647..9ebb3ab 100755 --- a/phpenmod +++ b/phpenmod @@ -288,7 +288,7 @@ while read -r line; do done <<< $PARAMS # check if Scan this dir for additional .ini files is not empty -[[ SCAN != "(none)" ]] && echo -e "please build with ./configure --with-config-file-scan-dir=PATH\n" && exit 1 +[[ $SCAN == "(none)" ]] && echo -e "please build with ./configure --with-config-file-scan-dir=PATH\n" && exit 1 # integer return value variable declare -i RETVAL=0 From cf55694421e189ded6e8cf74e685c1c4fbb28457 Mon Sep 17 00:00:00 2001 From: Orestes Sanchez Benavente Date: Sat, 24 Jun 2023 23:41:22 +0200 Subject: [PATCH 3/4] Solve a typo on README. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9d79d5e..93efbc9 100644 --- a/README.md +++ b/README.md @@ -23,10 +23,12 @@ make -j4 && sudo make install ``` ### Extension installation +``` cd ~/src/php-src/ext/readline phpize && ./configure && make -j4 && sudo make install cd ~/src/php-src/ext/mbstring phpize && ./configure && make -j4 && sudo make install +``` ### phpenmod installation ``` From 519e2d61ce23172ac738f92138416380ecc638af Mon Sep 17 00:00:00 2001 From: Orestes Sanchez Benavente Date: Sat, 24 Jun 2023 23:43:19 +0200 Subject: [PATCH 4/4] Show how to use new feature. --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 93efbc9..ef0410d 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,12 @@ phpenmod: Ini file not found. Trying to create new... phpenmod: Done. ``` +#### Use with a different PHP version +``` +[ru@ru-manjaro php.d]$ export PHP_BIN=php81 +[ru@ru-manjaro php.d]$ phpenmod readline mbstring +``` + #### Listing scan directory ``` ls /etc/php/php.d/