[PHP-CVS] cvs: php4 /sapi/apache2handler sapi_apache2.c
ianhMon Mar 17 16:28:41 2003 EDT Modified files: /php4/sapi/apache2handler sapi_apache2.c Log: PR#22672 - User not logged under Apache2 patch provided by Andrew Bradford. Index: php4/sapi/apache2handler/sapi_apache2.c diff -u php4/sapi/apache2handler/sapi_apache2.c:1.5 php4/sapi/apache2handler/sapi_apache2.c:1.6 --- php4/sapi/apache2handler/sapi_apache2.c:1.5 Fri Mar 7 08:45:33 2003 +++ php4/sapi/apache2handler/sapi_apache2.c Mon Mar 17 16:28:41 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: sapi_apache2.c,v 1.5 2003/03/07 13:45:33 iliaa Exp $ */ +/* $Id: sapi_apache2.c,v 1.6 2003/03/17 21:28:41 ianh Exp $ */ #include fcntl.h @@ -429,6 +429,7 @@ if (!PG(safe_mode)) { auth = apr_table_get(r-headers_in, Authorization); php_handle_auth_data(auth TSRMLS_CC); +ctx-r-user = apr_pstrdup(ctx-r-pool, SG(request_info).auth_user); } else { SG(request_info).auth_user = NULL; SG(request_info).auth_password = NULL; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /sapi/apache2handler CREDITS README apache_config.c config.m4 php.sym php4apache2.dsp php_apache.h php_functions.c sapi_apache2.c
ianhSat Feb 15 17:16:03 2003 EDT Removed files: (Branch: PHP_4_3) /php4/sapi/apache2handler CREDITS apache_config.c config.m4 php.sym php4apache2.dsp php_apache.h php_functions.c sapi_apache2.c Modified files: /php4/sapi/apache2handler README Log: After short discussion, the #php.bugs mob decided that we don't want this in PHP_4_3 branch. At least as long as it doesn't work as well (or preferrably better :) than the apache2filter SAPI does. So please remove it from the branch for now.. --Jani Index: php4/sapi/apache2handler/README diff -u php4/sapi/apache2handler/README:1.1.2.1 php4/sapi/apache2handler/README:1.1.2.2 --- php4/sapi/apache2handler/README:1.1.2.1 Sat Feb 15 00:49:31 2003 +++ php4/sapi/apache2handler/README Sat Feb 15 17:16:03 2003 @@ -1,76 +1,9 @@ -WHAT IS THIS? -This module exploits the layered I/O support in Apache 2.0. - -HOW DOES IT WORK? - -In Apache 2.0, you have handlers which generate content (like -reading a script from disk). The content goes then through -a chain of filters. PHP can be such a filter, so that it processes -your script and hands the output to the next filter (which will -usually cause a write to the network). - -DOES IT WORK? - -Currently the issues with the module are: -* Thread safety of external PHP modules -* The lack of re-entrancy of PHP. due to this I have disabled the 'virtual' - function, and tried to stop any method where a php script can run another php - script while it is being run. - - -HOW TO INSTALL - -This SAPI module is known to work with Apache 2.0.44. - -$ cd apache-2.x -$ cd src -$ ./configure --enable-so -$ make install - -For testing purposes, you might want to use --with-mpm=prefork. -(Albeit PHP also works with threaded MPMs. See Thread Safety note above) - -Configure PHP 4: - -$ cd php-4.x -$ ./configure --with-apxs2=/path/to/apache-2.0/bin/apxs -$ make install - -At the end of conf/httpd.conf, add: - -AddType application/x-httpd-php .php - -If you would like to enable source code highlighting functionality add: +After short discussion, the #php.bugs mob decided that we don't want +this in PHP_4_3 branch. At least as long as it doesn't work as well +(or preferrably better :) than the apache2filter SAPI does. -AddType application/x-httpd-php-source .phps +So please remove it from the branch for now.. -That's it. Now start bin/httpd. - -HOW TO CONFIGURE - -The Apache 2.0 PHP module supports a new configuration directive that -allows an admin to override the php.ini search path. For example, -place your php.ini file in Apache's ServerRoot/conf directory and -add this to your httpd.conf file: - -PHPINIDir conf - -DEBUGGING APACHE AND PHP - -To debug Apache, we recommened: - -1. Use the Prefork MPM (Apache 1.3-like process model) by - configuring Apache with '--with-mpm=prefork'. -2. Start httpd using -DONE_PROCESS (e.g. (gdb) r -DONE_PROCESS). - -If you want to debug a part of the PHP startup procedure, set a -breakpoint on 'load_module'. Step through it until apr_dso_load() is -done. Then you can set a breakpoint on any PHP-related symbol. - -TODO - -PHP functions like apache_sub_req (see php_functions.c) -Source Code Highlighting -Protocol handlers +--Jani -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /sapi/apache2handler .cvsignore CREDITS README apache_config.c config.m4 php.sym php4apache2.dsp php_apache.h php_functions.c sapi_apache2.c
ianhSat Feb 15 00:49:31 2003 EDT Added files: (Branch: PHP_4_3) /php4/sapi/apache2handler .cvsignore CREDITS README apache_config.c config.m4 php.sym php4apache2.dsp php_apache.h php_functions.c sapi_apache2.c Log: alternate apache2 SAPI. Index: php4/sapi/apache2handler/.cvsignore +++ php4/sapi/apache2handler/.cvsignore libphp4.module *.la *.lo deps *.plg *.opt *.ncb Release Release_inline Debug Release_TS Release_TSDbg Release_TS_inline Debug_TS Index: php4/sapi/apache2handler/apache_config.c +++ php4/sapi/apache2handler/apache_config.c /* +--+ | PHP Version 4| +--+ | Copyright (c) 1997-2003 The PHP Group| +--+ | This source file is subject to version 2.02 of the PHP license, | | that is bundled with this package in the file LICENSE, and is| | available at through the world-wide-web at | | http://www.php.net/license/2_02.txt. | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | [EMAIL PROTECTED] so we can mail you a copy immediately. | +--+ | Author: Sascha Schumann [EMAIL PROTECTED] | +--+ */ /* $Id: apache_config.c,v 1.1 2003/02/11 17:40:11 ianh Exp $ */ #include php.h #include php_ini.h #include php_apache.h #include apr_strings.h #include ap_config.h #include util_filter.h #include httpd.h #include http_config.h #include http_request.h #include http_core.h #include http_protocol.h #include http_log.h #include http_main.h #include util_script.h #include http_core.h #ifdef PHP_AP_DEBUG #define phpapdebug(a) fprintf a #else #define phpapdebug(a) #endif typedef struct { HashTable config; } php_conf_rec; typedef struct { char *value; size_t value_len; char status; } php_dir_entry; static const char *real_value_hnd(cmd_parms *cmd, void *dummy, const char *name, const char *value, int status) { php_conf_rec *d = dummy; php_dir_entry e; phpapdebug((stderr, Getting %s=%s for %p (%d)\n, name, value, dummy, zend_hash_num_elements(d-config))); if (!strncasecmp(value, none, sizeof(none))) { value = ; } e.value = apr_pstrdup(cmd-pool, value); e.value_len = strlen(value); e.status = status; zend_hash_update(d-config, (char *) name, strlen(name) + 1, e, sizeof(e), NULL); return NULL; } static const char *php_apache_value_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) { return real_value_hnd(cmd, dummy, name, value, PHP_INI_PERDIR); } static const char *php_apache_admin_value_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) { return real_value_hnd(cmd, dummy, name, value, PHP_INI_SYSTEM); } static const char *real_flag_hnd(cmd_parms *cmd, void *dummy, const char *arg1, const char *arg2, int status) { char bool_val[2]; if (!strcasecmp(arg2, On) || (arg2[0] == '1' arg2[1] == '\0')) { bool_val[0] = '1'; } else { bool_val[0] = '0'; } bool_val[1] = 0; return real_value_hnd(cmd, dummy, arg1, bool_val, status); } static const char *php_apache_flag_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) { return real_flag_hnd(cmd, dummy, name, value, PHP_INI_PERDIR); } static const char *php_apache_admin_flag_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) { return real_flag_hnd(cmd, dummy, name, value, PHP_INI_SYSTEM); } static const char *php_apache_phpini_set(cmd_parms *cmd, void *mconfig, const char *arg) { if (apache2_php_ini_path_override) { return Only first PHPINIDir directive honored per configuration tree - subsequent ones ignored; } apache2_php_ini_path_override = ap_server_root_relative(cmd-pool, arg); return NULL; } void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf) { php_conf_rec *d = base_conf, *e = new_conf;
[PHP-CVS] cvs: php4 /sapi/apache2handler .cvsignore CREDITS README apache_config.c config.m4 php.sym php4apache2.dsp php_apache.h php_functions.c sapi_apache2.c
ianhTue Feb 11 12:40:11 2003 EDT Added files: /php4/sapi/apache2handler .cvsignore CREDITS README apache_config.c config.m4 php.sym php4apache2.dsp php_apache.h php_functions.c sapi_apache2.c Log: initial checkin of the apache2 SAPI using a handler instead of filters. TBD: src highlighting better post handling Index: php4/sapi/apache2handler/.cvsignore +++ php4/sapi/apache2handler/.cvsignore libphp4.module *.la *.lo deps *.plg *.opt *.ncb Release Release_inline Debug Release_TS Release_TSDbg Release_TS_inline Debug_TS Index: php4/sapi/apache2handler/apache_config.c +++ php4/sapi/apache2handler/apache_config.c /* +--+ | PHP Version 4| +--+ | Copyright (c) 1997-2003 The PHP Group| +--+ | This source file is subject to version 2.02 of the PHP license, | | that is bundled with this package in the file LICENSE, and is| | available at through the world-wide-web at | | http://www.php.net/license/2_02.txt. | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | [EMAIL PROTECTED] so we can mail you a copy immediately. | +--+ | Author: Sascha Schumann [EMAIL PROTECTED] | +--+ */ /* $Id: apache_config.c,v 1.1 2003/02/11 17:40:11 ianh Exp $ */ #include php.h #include php_ini.h #include php_apache.h #include apr_strings.h #include ap_config.h #include util_filter.h #include httpd.h #include http_config.h #include http_request.h #include http_core.h #include http_protocol.h #include http_log.h #include http_main.h #include util_script.h #include http_core.h #ifdef PHP_AP_DEBUG #define phpapdebug(a) fprintf a #else #define phpapdebug(a) #endif typedef struct { HashTable config; } php_conf_rec; typedef struct { char *value; size_t value_len; char status; } php_dir_entry; static const char *real_value_hnd(cmd_parms *cmd, void *dummy, const char *name, const char *value, int status) { php_conf_rec *d = dummy; php_dir_entry e; phpapdebug((stderr, Getting %s=%s for %p (%d)\n, name, value, dummy, zend_hash_num_elements(d-config))); if (!strncasecmp(value, none, sizeof(none))) { value = ; } e.value = apr_pstrdup(cmd-pool, value); e.value_len = strlen(value); e.status = status; zend_hash_update(d-config, (char *) name, strlen(name) + 1, e, sizeof(e), NULL); return NULL; } static const char *php_apache_value_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) { return real_value_hnd(cmd, dummy, name, value, PHP_INI_PERDIR); } static const char *php_apache_admin_value_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) { return real_value_hnd(cmd, dummy, name, value, PHP_INI_SYSTEM); } static const char *real_flag_hnd(cmd_parms *cmd, void *dummy, const char *arg1, const char *arg2, int status) { char bool_val[2]; if (!strcasecmp(arg2, On) || (arg2[0] == '1' arg2[1] == '\0')) { bool_val[0] = '1'; } else { bool_val[0] = '0'; } bool_val[1] = 0; return real_value_hnd(cmd, dummy, arg1, bool_val, status); } static const char *php_apache_flag_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) { return real_flag_hnd(cmd, dummy, name, value, PHP_INI_PERDIR); } static const char *php_apache_admin_flag_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) { return real_flag_hnd(cmd, dummy, name, value, PHP_INI_SYSTEM); } static const char *php_apache_phpini_set(cmd_parms *cmd, void *mconfig, const char *arg) { if (apache2_php_ini_path_override) { return Only first PHPINIDir directive honored per configuration tree - subsequent ones ignored; } apache2_php_ini_path_override = ap_server_root_relative(cmd-pool, arg); return NULL; } void *merge_php_config(apr_pool_t *p, void *base_conf, void