diff --git a/INSTALL b/INSTALL index b8208d752cd5f..219d72a9db975 100644 --- a/INSTALL +++ b/INSTALL @@ -1,7 +1,7 @@ -Installation Instructions for PHP3 ----------------------------------- +Installation Instructions for PHP 4.0 +------------------------------------- -For the impatient here is a quick set of steps that will build PHP3 +For the impatient here is a quick set of steps that will build PHP as an Apache module for Apache 1.3.0 with MySQL support. A more verbose explanation follows. @@ -25,26 +25,26 @@ cd ../apache_1.3.x make (you should now have an httpd binary which you can copy to your Apache bin dir) cd ../php-3.0.x -cp php3.ini-dist /usr/local/lib/php3.ini -You can edit /usr/local/lib/php3.ini file to set PHP options. +cp php.ini-dist /usr/local/lib/php.ini +You can edit /usr/local/lib/php.ini file to set PHP options. Edit your httpd.conf or srm.conf file and add: - AddType application/x-httpd-php3 .php3 + AddType application/x-httpd-php .php VERBOSE INSTALL -Installing PHP3 can be done in four simple steps: +Installing PHP can be done in four simple steps: 1. Unpack your distribution file. - You will have downloaded a file named something like php3xn.tar.gz. - Unzip this file with a command like: gunzip php3xn.tar.gz + You will have downloaded a file named something like php4xn.tar.gz. + Unzip this file with a command like: gunzip php4xn.tar.gz - Next you have to untar it with: tar -xvf php3xn.tar + Next you have to untar it with: tar -xvf php4xn.tar This will create a php-3.0.x directory. cd into this new directory. -2. Configure PHP3. +2. Configure PHP. You now have to choose the options you would like. There are quite a few of them. To see a list, type: ./configure --help @@ -110,7 +110,7 @@ Installing PHP3 can be done in four simple steps: For Apache 1.2.x add: - Module php3_module mod_php4.o + Module php4_module mod_php4.o For Apache 1.2.x you will also have to look in the libphp4.module file, which was copied to the src directory. The EXTRA_LIBS line in the Apache @@ -120,7 +120,7 @@ Installing PHP3 can be done in four simple steps: So, as an example, your EXTRA_LIBS line might look like: - EXTRA_LIBS=-L. -lphp3 -lgdbm -ldb -L/usr/local/mysql/lib -lmysqlclient + EXTRA_LIBS=-L. -lphp4 -lgdbm -ldb -L/usr/local/mysql/lib -lmysqlclient NOTE: You should not enclose the EXTRA_LIBS line in double-quotes, as it is in the libphp4.module file. @@ -144,13 +144,13 @@ Installing PHP3 can be done in four simple steps: a backup of your previous one first. Then edit your conf/srm.conf file and add the line: - AddType application/x-httpd-php3 .php3 + AddType application/x-httpd-php .php There is also an interesting feature which can be quite instructive and helpful while debugging. That is the option of having colour syntax highlighting. To enable this, add the following line: - AddType application/x-httpd-php3-source .phps + AddType application/x-httpd-php-source .phps Any file ending in .phps will now be displayed with full colour syntax highlighting instead of being executed. diff --git a/mod_php4.c b/mod_php4.c index 5dbf8aaa6a7ec..4354b62f9bc35 100644 --- a/mod_php4.c +++ b/mod_php4.c @@ -391,7 +391,19 @@ static void *php_merge_dir(pool *p, void *basev, void *addv) #define CONST_PREFIX #endif -CONST_PREFIX char *php_apache_value_handler(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2) +CONST_PREFIX char *php_apache_value_handler(cmd_parms *cmd, php_apache_info_struct *conf, char *arg1, char *arg2) +{ + return php_apache_value_handler_ex(cmd, conf, arg1, arg2, PHP_INI_PERDIR); +} + + +CONST_PREFIX char *php_apache_admin_value_handler(cmd_parms *cmd, php_apache_info_struct *conf, char *arg1, char *arg2) +{ + return php_apache_value_handler_ex(cmd, conf, arg1, arg2, PHP_INI_SYSTEM); +} + + +CONST_PREFIX char *php_apache_value_handler_ex(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2, int mode) { php_per_dir_entry per_dir_entry; @@ -400,7 +412,7 @@ CONST_PREFIX char *php_apache_value_handler(cmd_parms *cmd, HashTable *conf, cha php_module_startup(&sapi_module); apache_php_initialized = 1; } - per_dir_entry.type = PHP_INI_PERDIR; + per_dir_entry.type = mode; per_dir_entry.key_length = strlen(arg1); per_dir_entry.value_length = strlen(arg2); @@ -418,7 +430,19 @@ CONST_PREFIX char *php_apache_value_handler(cmd_parms *cmd, HashTable *conf, cha } -CONST_PREFIX char *php_apache_flag_handler(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2) +CONST_PREFIX char *php_apache_flag_handler(cmd_parms *cmd, php_apache_info_struct *conf, char *arg1, char *arg2) +{ + return php_apache_flag_handler_ex(cmd, conf, arg1, arg2, PHP_INI_PERDIR); +} + + +CONST_PREFIX char *php_apache_admin_flag_handler(cmd_parms *cmd, php_apache_info_struct *conf, char *arg1, char *arg2) +{ + return php_apache_flag_handler_ex(cmd, conf, arg1, arg2, PHP_INI_SYSTEM); +} + + +CONST_PREFIX char *php_apache_flag_handler_ex(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2, int mode) { char bool_val[2]; @@ -429,7 +453,7 @@ CONST_PREFIX char *php_apache_flag_handler(cmd_parms *cmd, HashTable *conf, char } bool_val[1] = 0; - return php_apache_value_handler(cmd, conf, arg1, bool_val); + return php_apache_value_handler_ex(cmd, conf, arg1, bool_val, mode); } @@ -523,7 +547,9 @@ handler_rec php_handlers[] = command_rec php_commands[] = { {"php_value", php_apache_value_handler, NULL, OR_OPTIONS, TAKE2, "PHP Value Modifier"}, - {"php_flag", php_apache_flag_handler, NULL, OR_OPTIONS, TAKE2, "PHP Flag Modifier"}, + {"php_flag", php_apache_flag_handler, NULL, OR_OPTIONS, TAKE2, "PHP Flag Modifier"}, + {"php_admin_value", php_apache_admin_value_handler, NULL, ACCESS_CONF|RSRC_CONF, TAKE2, "PHP Value Modifier (Admin)"}, + {"php_admin_flag", php_apache_admin_flag_handler, NULL, ACCESS_CONF|RSRC_CONF, TAKE2, "PHP Flag Modifier (Admin)"}, {NULL} }; diff --git a/php4dllts.dsp b/php4dllts.dsp index 6fa38d8ca9ef1..2140dab5c80a8 100644 --- a/php4dllts.dsp +++ b/php4dllts.dsp @@ -794,6 +794,10 @@ InputPath=".\configuration-scanner.l" SOURCE=.\LICENSE # End Source File +# Begin Source File + +SOURCE=".\php.ini-dist" +# End Source File # End Group # End Target # End Project