diff options
author | Felipe Pena <felipe@php.net> | 2011-07-06 01:54:54 +0000 |
---|---|---|
committer | Felipe Pena <felipe@php.net> | 2011-07-06 01:54:54 +0000 |
commit | 93776977d8a5531eca45823176d0315cb8ca830b (patch) | |
tree | 9d49d0d54792bd3358c398fda9fdd10ec5dcbce6 /sapi/cli/php_cli_server.c | |
parent | 8953916314338b40c1304972b799c80c79f59683 (diff) | |
download | php-git-93776977d8a5531eca45823176d0315cb8ca830b.tar.gz |
- Fixed bug #55076 (requires() fails in a subdirectory with the in-built webserver)
Diffstat (limited to 'sapi/cli/php_cli_server.c')
-rw-r--r-- | sapi/cli/php_cli_server.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index 365f352244..66d3bc5ae4 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -2060,6 +2060,8 @@ int do_cli_server(int argc, char **argv TSRMLS_DC) /* {{{ */ if (document_root) { struct stat sb; + char resolved_path[MAXPATHLEN]; + if (stat(document_root, &sb)) { fprintf(stderr, "Directory %s does not exist.\n", document_root); return 1; @@ -2068,6 +2070,9 @@ int do_cli_server(int argc, char **argv TSRMLS_DC) /* {{{ */ fprintf(stderr, "%s is not a directory.\n", document_root); return 1; } + if (VCWD_REALPATH(document_root, resolved_path)) { + document_root = resolved_path; + } } else { char path[MAXPATHLEN]; char *ret = NULL; |