Commit Graph

431 Commits

Author SHA1 Message Date
Dmitry Stogov
b441b275b3 Fixed bug #42699 (PHP_SELF duplicates path) 2007-09-24 11:40:05 +00:00
Dmitry Stogov
96810f0ae6 Fixed bug #42587 (behaviour change regarding symlinked .php files) 2007-09-10 10:55:26 +00:00
Dmitry Stogov
5d238efaa6 Fixed bug #42523 (PHP_SELF duplicates path) 2007-09-05 08:26:32 +00:00
Dmitry Stogov
39bceffc4a Fixed bug #42453 (CGI SAPI does not shut down cleanly with -i/-m/-v cmdline options) 2007-08-31 12:17:52 +00:00
Stanislav Malyshev
50293835bf remove unneeded variables 2007-08-08 23:51:57 +00:00
Dmitry Stogov
50aef7ec83 - Fixed bug #42198 (SCRIPT_NAME and PHP_SELF truncated when inside a userdir
and using PATH_INFO).
- Fixed bug #31892 (PHP_SELF incorrect without cgi.fix_pathinfo, but turning
  on screws up PATH_INFO).
2007-08-08 13:01:40 +00:00
Jani Taskinen
9c07366bb0 MFH: fix typos in comments 2007-08-08 10:00:34 +00:00
Dmitry Stogov
e5909f149c Fixed bug #40419 (Trailing Slash in CGI request don't work) 2007-06-26 14:47:16 +00:00
Dmitry Stogov
5d2180835a no need to return exit status of the last fastcgi request 2007-06-21 08:40:43 +00:00
Antony Dovgal
5c75e5b4f4 MFH: add missing open_basedir checks to CGI 2007-06-04 15:38:12 +00:00
Dmitry Stogov
e35679618e Removed deprecated comment 2007-05-28 08:11:59 +00:00
Dmitry Stogov
23409a4bbf Fixed crash on "php -b 1234 -unknown-option" 2007-05-21 09:08:13 +00:00
Ilia Alshanetsky
30dd6a45d3 Fixed a possible crash when PATH_INFO is not provided but the path contains
path info information
2007-05-20 15:56:10 +00:00
Dmitry Stogov
633aff5541 Fixed bug #41378 (fastcgi protocol lacks support for Reason-Phrase in "Status:" header) 2007-05-15 08:17:08 +00:00
foobar
4f54b301ef - Fix a possible leak when multiple -c parameters are used 2007-04-17 20:00:53 +00:00
Antony Dovgal
44066f23b7 MFH: fix leak appearing when more than one -f option specified 2007-04-17 18:51:34 +00:00
foobar
2fe7267d53 MFH: Simplify previous patch. 2007-04-15 23:06:08 +00:00
foobar
a40b6f5c4f - Allow using syntax highlighting under FastCGI mode. 2007-04-15 22:52:07 +00:00
Sara Golemon
52b07d1895 Add missing #if check 2007-03-29 18:47:04 +00:00
Dmitry Stogov
4a119f9a79 Improved FastCGI SAPI to support external pipe and socket servers on win32 2007-03-28 15:39:22 +00:00
Dmitry Stogov
c2a71f8eb1 Return HTTP 403 in case of "access denied". 2007-03-09 16:46:07 +00:00
Ilia Alshanetsky
efad70c2cc snprintf() -> slprintf() 2007-02-27 03:28:17 +00:00
Marcus Boerger
50ea26760d - Avoid sprintf, even when checked copy'n'paste or changes lead to errors 2007-02-24 02:17:47 +00:00
Antony Dovgal
748b6fdeb3 MFH: make use of startup hooks 2007-02-20 19:20:41 +00:00
Ilia Alshanetsky
9ae588dfb1 Fixed strlcat() usage.
# Thanks Andi
2007-02-19 23:52:13 +00:00
Dmitry Stogov
2a170f0584 Initialize "retval" on each request 2007-02-19 14:13:02 +00:00
Ilia Alshanetsky
26214fc15f Eliminate strcat() usage
Fixed handling of argv[] for GET
2007-02-18 18:08:22 +00:00
Dmitry Stogov
780c66d14b Fixed bug #40286 (PHP fastcgi with PHP_FCGI_CHILDREN don't kill children when parent is killed) 2007-02-16 11:30:03 +00:00
Dmitry Stogov
a79d74b694 Fixed bug #40414 (possivle endless fork() loop when running fastcgi) 2007-02-15 12:33:16 +00:00
Dmitry Stogov
d44cb7fa7b Prevent flush of closed handle on php_module_shutdown() 2007-01-29 19:36:01 +00:00
Sebastian Bergmann
4223aa4d5e MFH: Bump year. 2007-01-01 09:36:18 +00:00
Antony Dovgal
2820e6c1fa MFH 2006-12-28 22:36:53 +00:00
Dmitry Stogov
8619bf8332 Removed unnecessary getenv/putenv calls 2006-11-15 13:33:41 +00:00
Dmitry Stogov
0916ac47c9 Fixed wrong ext/filter behavior. It didn't register FastCGI environment variables and made memory leaks. 2006-11-15 11:13:02 +00:00
Dmitry Stogov
5caf547a9f cgi.* and fastcgi.* directives are moved to INI subsystem. The new directive cgi.check_shebang_line can be used to ommiting checnk for "#! /usr/bin/php" line. 2006-11-14 10:31:47 +00:00
Pierre Joye
c002606a88 - fix build (var.s is for zstr) 2006-11-03 16:40:52 +00:00
Ilia Alshanetsky
6123f11021 MFH:
Added filter support for $_SERVER in cgi/apache2 sapis
	Make sure PHP_SELF is filtered in Apache 1 sapi
2006-11-03 13:51:48 +00:00
Antony Dovgal
bc81c718c8 fix CGI build 2006-09-23 12:27:40 +00:00
Ilia Alshanetsky
be18d5f345 Restore support for unquoted -d options 2006-09-22 17:41:09 +00:00
Dmitry Stogov
7d14dad02e MFH: Fixed mess with CGI/CLI -d command line option (now it works with cgi; constants are working exactly like in php.ini; with FastCGI -d affects all requests). 2006-09-19 20:33:12 +00:00
Dmitry Stogov
f9d9c4a6aa FastCGI environment variables must not be overriden by system environment variables 2006-08-31 13:11:58 +00:00
Antony Dovgal
6c52ec1319 MFH: fix #37920 (compilation problems on z/OS) 2006-06-27 08:27:10 +00:00
Antony Dovgal
33616195b9 MFH: plug leak in CGI SAPI when running scripts with query string in console 2006-06-19 17:49:26 +00:00
Antony Dovgal
cd7d7039ac MFH: add missing ifdef and avoid "unused variable" warning 2006-06-19 11:39:02 +00:00
Nuno Lopes
6509311ebb plug memory leak in sapi_putenv, by using setenv(), that doesnt need any malloc 2006-06-17 11:08:05 +00:00
Dmitry Stogov
eb8c558966 Removed warnings 2006-06-13 14:22:46 +00:00
Johannes Schlüter
2f418134ff MFH 2006-06-03 22:02:02 +00:00
Dmitry Stogov
6fe36adf0c Fixed bug #37256 (php-fastcgi dosen't handle connection abort) 2006-05-24 09:42:21 +00:00
Dmitry Stogov
07b8d051fa Fixed bug #37341 ($_SERVER in included file is shortened to two entries, if $_ENV gets used). 2006-05-24 07:55:19 +00:00
Dmitry Stogov
b5cd968ffc - Removed source compatibility with libfcgi
- Optimized access to FastCGI environment using HashTable instead of linear search
- Allowed PHP_FCGI_MAX_REQUESTS=0 to disable PHP die
- Allowed PHP_FCGI_CHILDREN=0 to disable PHP spawn workers
2006-05-15 14:30:31 +00:00
Antony Dovgal
24f0701867 MFH: plug leak 2006-05-03 19:40:58 +00:00
Dmitry Stogov
73e4913cca Fixed memory leaks 2006-04-18 06:58:43 +00:00
Dmitry Stogov
79b3d79a95 CGI anf FastCGI assume $_SERVER and $_ENV have the same values,
so we don't need construct the same arrays twich and may just copy it
2006-04-07 13:45:23 +00:00
Dmitry Stogov
8c40d605e4 Removed unnecessary copying 2006-04-07 12:39:43 +00:00
Dmitry Stogov
cb3a53db83 Cleanup 2006-03-23 10:19:30 +00:00
Dmitry Stogov
0c1b4f45eb Allowed '-b' with UNIX sockets:
-b <hostname>:<port_number>
  -b <port_number>
  -b <unix_socket_path>
2006-03-23 10:15:01 +00:00
Dmitry Stogov
76a7240d70 Optimized FastCGI SAPI check. Check for ini options only once. 2006-03-17 09:32:30 +00:00
Alex Waugh
b8d26da1be MFH Fix for RISC OS 2006-03-07 22:37:53 +00:00
Dmitry Stogov
aa1142eded Fixed bug #36158 (SIGTERM is not handled correctly when running as a FastCGI server) 2006-02-03 16:30:09 +00:00
Dmitry Stogov
7e7fcc3a07 Reimplement FastCGI interface
Due to licensing restrictions that actually don't allow anybody to use
the libfcgi code without prior approval from Open Market, which is
impossible to obtain - we decided to reimplement this interface from
scratch.  The result is actually slightly faster, and more importantly,
clear of any copyright issues.
2006-02-02 08:17:23 +00:00
foobar
5bd93221a8 bump year and license version 2006-01-01 12:51:34 +00:00
Dmitry Stogov
5461b5a6b1 Fixed bug #34429 (Output buffering cannot be turned off with FastCGI) 2005-12-09 17:01:50 +00:00
foobar
bde40a73db MFH: fix possible compile error 2005-12-03 01:28:16 +00:00
Michael Wallner
496fd1c041 - sapi_header_op(SAPI_HEADER_(REPLACE|ADD), {NULL, 0, 0}) caused HTTP response splitting
- sapi_send_headers() already takes care of default_content_type (left over of fix for bug #29983)
2005-11-02 14:38:13 +00:00
Johannes Schlüter
d3dc0a39bc - MFH: Fix #34557 php -m exits with "error" 1 2005-10-06 20:29:41 +00:00
foobar
20241fe16a - 2004 -> 2005 2005-08-03 11:12:19 +00:00
Wez Furlong
43aa6922d3 Don't crash here if there are errors (such as failing to load extensions via
php.ini) during startup.
2005-06-16 14:54:51 +00:00
foobar
51eebc6096 cs + ws 2005-06-03 23:11:51 +00:00
foobar
8c2cda1251 int != long 2005-04-28 14:23:57 +00:00
foobar
03bdd1a5d4 - Added fastcgi.logging php.ini option to be able to disable
logging through the fastcgi connection
2005-04-28 13:14:26 +00:00
Rasmus Lerdorf
3c0411c496 Fix for bug #32263
This adds proto_num to request_info.  It is defaulted to HTTP 1.0 (1000)
such that it has a valid value even if the underlying sapi doesn't set it
correctly.  It is then used to determine if a 302 or a 303 should be sent
on a Location redirect.  Any non GET/HEAD HTTP 1.1 redirect will get a 303
instead of a 302 to be compatible with the HTTP spec.
2005-03-14 19:25:39 +00:00
foobar
59db0751fc Revert previous patch 2005-02-11 02:03:51 +00:00
foobar
951eb23e9a - Fixed bug #28227 (PHP CGI depends upon non-standard SCRIPT_FILENAME)
# patch by: lukem at NetBSD dot org
2005-02-04 10:39:33 +00:00
foobar
376d5f6910 Fix ZTS build 2005-01-11 13:35:56 +00:00
foobar
40b9c63da1 - Fixed bug #28074 (FastCGI: stderr should be written in a FCGI stderr stream). 2005-01-10 15:38:24 +00:00
Rasmus Lerdorf
fdaa130f3a Add the new request_time sapi struct entry to all the sapis. Some of these
may have ways of getting the request time without the extra syscall, but
for now let's just make sure we don't crash and people will eventually
fill these in where applicable.
2004-12-20 19:33:41 +00:00
Edin Kadribasic
546e5bbc43 Made php -m output sorted case-insensitevly 2004-07-14 22:30:29 +00:00
Sascha Schumann
f51ff68dfa - revert to proper behaviour 2004-07-05 11:41:31 +00:00
Stanislav Malyshev
74ab20817a Fix fastCGI breakage: due to calling flush on unitialized requests,
request was aborted unless ignore_user_abort is set
2004-05-06 15:23:53 +00:00
Ilia Alshanetsky
39a43c994e Fixed bug #27802 (default number of children to 8 when PHP_FCGI_CHILDREN is
not defined).
2004-03-31 17:01:01 +00:00
Ilia Alshanetsky
ed2b1770ab Invalid response code when force-cgi-redirect safety mechanism is triggered 2004-03-12 14:05:59 +00:00
Rasmus Lerdorf
2a44432e8c As discussed a while ago. There is no reason to disallow command-line
arguments for the cgi version when run in a cgi context.  Our own test
framework is in fact broken because of this unnecessary restriction.
2004-02-27 23:31:28 +00:00
Marcus Boerger
1c00296cc7 Bugfix #27104 CLI/CGI SAPI module variable name conflict 2004-02-11 21:00:46 +00:00
Ilia Alshanetsky
c6a2a19051 Proper win32 fix. 2004-02-11 14:52:12 +00:00
Ilia Alshanetsky
9c1be88844 Fixed win32 build.
Fixed building of libfcgi when PHP is built from another directory.
Added missing headers needed for wait().
Removed duplicate signal.h header.
Removed unneeded variables.
2004-02-10 17:44:31 +00:00
Ilia Alshanetsky
242296faeb Fixed bug #26758 (FastCGI exits immediately with status 255). 2004-02-10 00:29:46 +00:00
Ilia Alshanetsky
0f9d01d8ac Fixed bug #27026 (Added cgi.nph that allows forcing of the Status: 200
header that is not normally needed).
2004-02-10 00:02:38 +00:00
Andi Gutmans
dbeb4158d2 - A belated happy holidays and PHP 5 2004-01-08 08:18:22 +00:00
foobar
b4c05a5068 MFB 2003-10-31 01:29:59 +00:00
Ilia Alshanetsky
4c4d5a02b9 Fixed formatting issues (patch by: Joe Orton) 2003-10-17 02:21:27 +00:00
Sascha Schumann
45a928ef94 fix heuristic: if someone passed "-b IP:port", this check would
falsely recognize the parameter as defining only a port.
2003-09-03 08:15:09 +00:00
Marcus Boerger
cbb011da2d Fix interactive mode 2003-08-17 18:36:27 +00:00
Ilia Alshanetsky
f6290bfbfd Don't forget to flush() buffers for -w -s 2003-08-13 02:01:46 +00:00
Sascha Schumann
f622240a0e MFB don't overwrite 2003-08-04 19:05:20 +00:00
Ilia Alshanetsky
3253746c26 Preserve exit status for non-php execution modes. 2003-08-01 16:52:49 +00:00
Ilia Alshanetsky
68616d764c Fixed bug #23509 (exit code lost when exit() called from
register_shutdown_function())
2003-08-01 12:26:28 +00:00
Shane Caraveo
42165c12b0 renable -b option (removed when longopts were added)
dissable -b on windows due to fastcgi lib bug
close stdin on linux when using socket server (bug 23664)
2003-06-29 20:45:38 +00:00
Shane Caraveo
97ffab21a6 fix bug http://bugs.php.net/bug.php?id=24009
also do not use APPL_PHYSICAL_PATH as DOCUMENT_ROOT under IIS, it's
different depending on IIS configuration.  Code works fine without it, that
was just an attempt at a shortcut.
2003-06-29 20:09:36 +00:00
James Cox
f68c7ff249 updating license information in the headers. 2003-06-10 20:04:29 +00:00
Edin Kadribasic
b7713f411e Fix for #23902 by Shane.
Removed bogus recommendation from php.ini files.

# Basic authentication is actually possible
# usign IIS + PHP cgi countrary to our current docs
2003-06-03 10:06:45 +00:00
Moriyoshi Koizumi
aa50e817ae CGI SAPI should honour this setting 2003-05-30 22:31:12 +00:00
Derick Rethans
814f793035 - MFB: Version output beautification 2003-05-30 16:10:58 +00:00
foobar
61e09677b2 MFB: nuked php_header() call from the sapi_cgi_log_message() 2003-05-26 23:22:05 +00:00
Shane Caraveo
ce91e18377 http://bugs.php.net/bug.php?id=14409
move from PHP_4_3
2003-05-26 00:46:24 +00:00
Shane Caraveo
92dfadb1e0 continuation on bugfix #13757
make argv/argc *and* query_string work correctly when running cgi in shell
2003-05-19 06:46:19 +00:00
Shane Caraveo
57f01b14e9 bugfix #13757 - passing query string on command line when run from shell 2003-05-19 03:40:33 +00:00
Moriyoshi Koizumi
bb1720a9d7 Fixed bug #23669 2003-05-17 18:47:17 +00:00
Moriyoshi Koizumi
db2de468e1 Fixed too optimized part 2003-03-29 16:18:04 +00:00
Moriyoshi Koizumi
8e8029f23d CS & WS fixes 2003-03-29 16:13:51 +00:00
Moriyoshi Koizumi
2ad3f446c3 Do the right fix.. 2003-03-28 18:24:02 +00:00
Moriyoshi Koizumi
0b6f629b68 Fixed bug #22773 2003-03-28 17:53:36 +00:00
Shane Caraveo
e949850881 handle invalid paths passed to us from iis 2003-03-27 17:52:33 +00:00
Sebastian Bergmann
5ca078779a Eliminate some TSRMLS_FETCH() calls. Tested with Win32 build of SAPI/CGI and SAPI/CLI on Win32. 2003-03-25 08:07:13 +00:00
Shane Caraveo
56210b8921 use the correct flush on deactivate
add some code to make debugging iis 5 cgi easier
2003-03-25 07:43:30 +00:00
Shane Caraveo
ac7748cef1 For fastcgi env vars, don't magic quote them 2003-03-23 20:16:41 +00:00
Stig Bakken
0e6fca4f22 * email address change 2003-03-18 12:06:09 +00:00
Ben Mansell
6d8283fa57 Fix bug whereby a webserver closing stdout from the CGI/FastCGI binary
would cause PHP to get caught in an infinite loop of failing write()
syscalls.
2003-03-07 14:48:28 +00:00
Zeev Suraski
4934744b93 Win32 build improvements 2003-02-17 13:29:59 +00:00
Shane Caraveo
8c73b6ab70 prevent possible crash if used in combo with mod_gzip
fix command line
2003-02-17 03:39:58 +00:00
Marcus Boerger
d4fd1c07b1 - Allow long option names
- Update CLI's manpage

@Added support for long options in CLI & CGI (e.g. --version). (Marcus)

# In contrast to the preliminary patch this should work now completely.
# If all long option names are accepted we may even think about MFHing.
2003-02-16 01:23:11 +00:00
foobar
92279e5e06 MFB 2003-02-14 14:38:20 +00:00
Marcus Boerger
aa8dfa0b74 fix non FCGI build 2003-02-13 19:46:40 +00:00
Shane Caraveo
a13ef6ec42 There is *absolutely no* definitive way to know if argv0 is the
actual php script, or if it is the beginning of a query string.
Additionaly, passing parameters on the command line is
not part of CGI spec, and is not required by either
Apache or IIS.  So I have removed that code altogether,
and done some further cleanup.  Also fix pre4.3 behaviour if fix_pathinfo=0.
I've tested with IIS and Apache 1.3.27 on w2k and RH 7.3.
2003-02-13 18:21:12 +00:00
Shane Caraveo
1a4c82e014 fix bug 21261
putenv on some platforms requires we provide the memory
    cleanup env parsing logic
fix bug 21367
    missed optargs in a previous patch
2003-01-25 22:01:53 +00:00
Ilia Alshanetsky
5de9962d50 Fixed bug #21297. The fix also fixes miscalculation of lines numbers by 1
due the previously mentioned bug.
2003-01-08 00:41:53 +00:00
Zeev Suraski
6591b9c826 Add missing call 2003-01-07 16:33:28 +00:00
Zeev Suraski
19d47d9f6e Initialize lineno using the new infrastructure 2003-01-05 16:10:35 +00:00
Sebastian Bergmann
2c5d4b8c23 Bump year. 2002-12-31 15:59:15 +00:00
George Schlossnagle
190867c800 fixed ws 2002-12-25 21:18:37 +00:00
George Schlossnagle
abbf745211 fix for 21177 2002-12-25 20:38:37 +00:00
Stefan Esser
66ebbb5ae1 fix compile warning 2002-12-24 23:46:17 +00:00
Shane Caraveo
75cbbfacb1 fix use of Alias under apache by defaulting script_name to redirect_url
dont lstat, stat.
2002-12-02 02:16:38 +00:00
Shane Caraveo
a3bd39429c Fix CGI to match cgi spec.
This patch properly fixes support for CGI in PHP.  For backwards compatible
broken behaviour, cgi.fix_pathinfo can be set to zero in php.ini.
CGI failed to work under apache at all, either using the cgi-script directive
or as a ScriptAlias setup. Typicaly it would try to parse itself.  This will
still happen if you dissable fix_pathinfo, and set DISCARD_PATH.
This also fixes PATH_INFO, and finally we can run pres2 under cgi or fastcgi.
This patch has been tested under Apache 1.3, 2.0, IIS, as both cgi and fastcgi,
on Windows and OSX.  A followup patch with build stuff for linux will follow.
2002-12-01 21:37:14 +00:00
foobar
dd53efc196 - Made the STANDARD_SAPI_MODULE_PROPERTIES be what it says it is. 2002-11-26 05:57:06 +00:00
Shane Caraveo
95b4045f48 configure now supports building the cgi-fcgi module
configure --enable-fastcgi
2002-11-26 05:51:16 +00:00
Edin Kadribasic
81711ba621 Avoid possible buffer overflow. 2002-11-22 15:47:39 +00:00
Edin Kadribasic
fd47c5bb32 MFB: Don't send default http status (200). 2002-11-22 13:55:27 +00:00
Edin Kadribasic
714a5be6cc Fixed bug #19207 by adding cgi.rfc2616_headers configuration directive. 2002-11-22 10:15:47 +00:00
Andrei Zmievski
ca332dfc96 Oops. 2002-11-15 00:32:42 +00:00
Andrei Zmievski
3e8a800a96 Fix function prototype. 2002-11-15 00:31:10 +00:00
Andrei Zmievski
e09d62c435 Sort the modules and extensions before printing them when -m switch is used. 2002-11-14 20:32:28 +00:00
Marcus Boerger
cecb9dfc79 Implemented -n switch to skip parsing ini at startup as suggested by Wez.
#The switch 'n' was planned to be used for beautifying....delete n to make
#clear these functions do not have a switch yet.
2002-11-12 20:56:47 +00:00
Hartmut Holzgraefe
cb6202bbe8 reverting accidential commit 2002-11-12 16:41:14 +00:00
Hartmut Holzgraefe
0c395d0f4c *** empty log message *** 2002-11-12 16:37:47 +00:00
Ilia Alshanetsky
64f77577f0 Fixed bug #20035. ZE now allows us to pass the current line position by
setting zend_lineno to (current_line * -1).
2002-11-05 22:04:12 +00:00
Derick Rethans
d82565fb7a - Fix build
#- Jan, please TEST! before committing :-)
2002-10-25 14:33:46 +00:00
Jan Lehnardt
ed29169f91 - alphabetcial output for php -h (cgi)
- cosmetics
2002-10-25 09:28:55 +00:00
Sascha Schumann
2909e5c9c9 centralize #include "build-defs.h" and drop (sometimes inconsistent) other
instances
2002-10-24 13:15:49 +00:00
Shane Caraveo
69f56e8c4a make fastcgi usage threadsafe, ready for future multithreaded fastcgi implementation
get rid of environment overwriting but hooking into php's environment function
set $_ENV correctly for mod_fastcgi
add -b to specify binding for fastcgi
new readme file with information for running under apache2.0 and iis
2002-10-13 09:40:44 +00:00
Zeev Suraski
d31604997b We leak quite a few things intentionally, if you want to debug it - enable
explicitly please..
2002-09-23 11:35:22 +00:00