Index: sapi/cgi/cgi_main.c =================================================================== RCS file: /repository/php-src/sapi/cgi/cgi_main.c,v retrieving revision 1.267.2.15.2.50.2.25 diff -u -p -r1.267.2.15.2.50.2.25 cgi_main.c --- sapi/cgi/cgi_main.c 18 Aug 2008 10:49:35 -0000 1.267.2.15.2.50.2.25 +++ sapi/cgi/cgi_main.c 25 Aug 2008 07:57:10 -0000 @@ -1931,7 +1931,8 @@ consult the installation file that came 2. we are running as cgi or fastcgi */ if (cgi || SG(request_info).path_translated) { - if (php_fopen_primary_script(&file_handle TSRMLS_CC) == FAILURE) { + if (php_check_open_basedir(SG(request_info).path_translated TSRMLS_CC) || + php_fopen_primary_script(&file_handle TSRMLS_CC) == FAILURE) { if (errno == EACCES) { SG(sapi_headers).http_response_code = 403; PUTS("Access denied.\n");