diff --git a/src/php/bin/determine_extension_dir.sh b/src/php/bin/determine_extension_dir.sh
index 11b23662dd6cbcaef021b3437d5f33ecef735f0f..6fc392afc0a46d013efc3140538bfc17d80d5e67 100755
--- a/src/php/bin/determine_extension_dir.sh
+++ b/src/php/bin/determine_extension_dir.sh
@@ -29,10 +29,10 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 set -e
-default_extension_dir=`php -i | grep extension_dir | sed 's/.*=> //g'`
-if command -v brew >/dev/null && [ -d `brew --prefix`/opt/grpc-php ]; then
+default_extension_dir=$(php -i | grep extension_dir | sed 's/.*=> //g')
+if command -v brew >/dev/null && [ -d $(brew --prefix)/opt/grpc-php ]; then
   # homebrew and the grpc-php formula are installed
-  extension_dir="-d extension_dir="`brew --prefix`/opt/grpc-php
+  extension_dir="-d extension_dir="$(brew --prefix)/opt/grpc-php
 elif [ ! -f $default_extension_dir/grpc.so ]; then
   # the grpc extension is not found in the default PHP extension dir
   # try the source modules directory
diff --git a/src/php/bin/run_gen_code_test.sh b/src/php/bin/run_gen_code_test.sh
index f8ad9598f46877df517764ac7ec78b5cb1a65b46..03a9101a458173ba2076ee1f2310ce9128634019 100755
--- a/src/php/bin/run_gen_code_test.sh
+++ b/src/php/bin/run_gen_code_test.sh
@@ -32,7 +32,7 @@ set -e
 cd $(dirname $0)
 source ./determine_extension_dir.sh
 export GRPC_TEST_HOST=localhost:7071
-php $extension_dir -d extension=grpc.so `which phpunit` -v --debug --strict \
+php $extension_dir -d extension=grpc.so $(which phpunit) -v --debug --strict \
   ../tests/generated_code/GeneratedCodeTest.php
-php $extension_dir -d extension=grpc.so `which phpunit` -v --debug --strict \
+php $extension_dir -d extension=grpc.so $(which phpunit) -v --debug --strict \
   ../tests/generated_code/GeneratedCodeWithCallbackTest.php
diff --git a/src/php/bin/run_tests.sh b/src/php/bin/run_tests.sh
index e3289e34d2bc4f7d9c2debd55e1e4f7333985cab..4c37285455bdf15b4d8680f4d65dc4fd696d55d9 100755
--- a/src/php/bin/run_tests.sh
+++ b/src/php/bin/run_tests.sh
@@ -33,5 +33,5 @@
 set -e
 cd $(dirname $0)
 source ./determine_extension_dir.sh
-php $extension_dir -d extension=grpc.so `which phpunit` -v --debug --strict \
+php $extension_dir -d extension=grpc.so $(which phpunit) -v --debug --strict \
   ../tests/unit_tests