#7106 - fix for ZTS builds
merged branch lizjulien/7106 (PR #7248)

This PR was submitted for the master branch but it was merged into the 2.1 branch instead (closes #7248).

Discussion
----------

#7106 - check php version for getcwd()

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #7106
| License       | MIT

Commits
-------

11d3855  #7106 - fix for ZTS builds