Skip to content
Open
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -49,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/
Expand Down
8 changes: 5 additions & 3 deletions phpenmod
Original file line number Diff line number Diff line change
Expand Up @@ -262,17 +262,19 @@ 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
exit 1
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 =>" \
`
Expand All @@ -286,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
Expand Down