Page 2 of 2 FirstFirst 12
Results 26 to 33 of 33
  1. #26
    The patch, apparently ran fine on my development box, will compile now.

    proof:

    [root@laboratory php-5.1.6]# patch -p1 < ../php5-sapi.patch
    patching file sapi/apache2filter/apache_config.c
    patching file sapi/apache2handler/apache_config.c
    patching file sapi/apache2handler/sapi_apache2.c
    patching file sapi/apache_hooks/mod_php5.c
    patching file sapi/apache/mod_php5.c
    patching file sapi/apache2filter/sapi_apache2.c
    [root@laboratory php-5.1.6]#

  2. #27

    Lightbulb no luck.

    well no luck.

    [Mon Oct 30 21:10:11 2006] [notice] child pid 20588 exit signal Segmentation fault (11)

    it goes that way.

    php4 tries to send the .php file, php5 showes up blank pages.

    its a shame that it cant be ran together.

    btw,

    OS: CentOS 4.4
    Apache/2.0.52
    php 4.4.4 and 5.1.6

    will have to stick to php4 as too many application on our servers are written in php4, and cant afford to break them by migrating to php5.

    anyway if anyone wants the patch to keep trying here is it. (if anyone get it working, let me know lol)

    Code:
    --- php-5.1.6/sapi/apache2filter/apache_config.c    2006-01-01 07:50:18.000000000 -0500
    +++ php-5.1.6/sapi/apache2filter/apache_config.c.new    2006-02-13 17:35:26.000000000 -0500
    @@ -189,13 +189,13 @@
     
     const command_rec php_dir_cmds[] =
     {
    -    AP_INIT_TAKE2("php_value", php_apache_value_handler, NULL, OR_OPTIONS,
    +    AP_INIT_TAKE2("php5_value", php_apache_value_handler, NULL, OR_OPTIONS,
                       "PHP Value Modifier"),
    -    AP_INIT_TAKE2("php_flag", php_apache_flag_handler, NULL, OR_OPTIONS,
    +    AP_INIT_TAKE2("php5_flag", php_apache_flag_handler, NULL, OR_OPTIONS,
                       "PHP Flag Modifier"),
    -    AP_INIT_TAKE2("php_admin_value", php_apache_admin_value_handler, NULL, 
    +    AP_INIT_TAKE2("php5_admin_value", php_apache_admin_value_handler, NULL, 
                 ACCESS_CONF|RSRC_CONF, "PHP Value Modifier (Admin)"),
    -    AP_INIT_TAKE2("php_admin_flag", php_apache_admin_flag_handler, NULL, 
    +    AP_INIT_TAKE2("php5_admin_flag", php_apache_admin_flag_handler, NULL, 
                 ACCESS_CONF|RSRC_CONF, "PHP Flag Modifier (Admin)"),
         AP_INIT_TAKE1("PHPINIDir", php_apache_phpini_set, NULL, RSRC_CONF,
                       "Directory containing the php.ini file"),
    --- php-5.1.6/sapi/apache2handler/apache_config.c    2006-01-01 07:50:18.000000000 -0500
    +++ php-5.1.6/sapi/apache2handler/apache_config.c.new    2006-02-13 17:35:57.000000000 -0500
    @@ -178,10 +178,10 @@
     
     const command_rec php_dir_cmds[] =
     {
    -    AP_INIT_TAKE2("php_value", php_apache_value_handler, NULL, OR_OPTIONS, "PHP Value Modifier"),
    -    AP_INIT_TAKE2("php_flag", php_apache_flag_handler, NULL, OR_OPTIONS, "PHP Flag Modifier"),
    -    AP_INIT_TAKE2("php_admin_value", php_apache_admin_value_handler, NULL, ACCESS_CONF|RSRC_CONF, "PHP Value Modifier (Admin)"),
    -    AP_INIT_TAKE2("php_admin_flag", php_apache_admin_flag_handler, NULL, ACCESS_CONF|RSRC_CONF, "PHP Flag Modifier (Admin)"),
    +    AP_INIT_TAKE2("php5_value", php_apache_value_handler, NULL, OR_OPTIONS, "PHP Value Modifier"),
    +    AP_INIT_TAKE2("php5_flag", php_apache_flag_handler, NULL, OR_OPTIONS, "PHP Flag Modifier"),
    +    AP_INIT_TAKE2("php5_admin_value", php_apache_admin_value_handler, NULL, ACCESS_CONF|RSRC_CONF, "PHP Value Modifier (Admin)"),
    +    AP_INIT_TAKE2("php5_admin_flag", php_apache_admin_flag_handler, NULL, ACCESS_CONF|RSRC_CONF, "PHP Flag Modifier (Admin)"),
         AP_INIT_TAKE1("PHPINIDir", php_apache_phpini_set, NULL, RSRC_CONF, "Directory containing the php.ini file"),
         {NULL}
     };
    --- php-5.1.6/sapi/apache2handler/sapi_apache2.c    2006-02-13 17:33:39.000000000 -0500
    +++ php-5.1.6/sapi/apache2handler/sapi_apache2.c.new    2006-02-13 17:34:00.000000000 -0500
    @@ -59,8 +59,8 @@
      */
     #undef shutdown
     
    -#define PHP_MAGIC_TYPE "application/x-httpd-php"
    -#define PHP_SOURCE_MAGIC_TYPE "application/x-httpd-php-source"
    +#define PHP_MAGIC_TYPE "application/x-httpd-php5"
    +#define PHP_SOURCE_MAGIC_TYPE "application/x-httpd-php5-source"
     #define PHP_SCRIPT "php5-script"
     
     /* A way to specify the location of the php.ini dir in an apache directive */
    --- php-5.1.6/sapi/apache_hooks/mod_php5.c    2006-01-01 07:50:18.000000000 -0500
    +++ php-5.1.6/sapi/apache_hooks/mod_php5.c.new    2006-02-13 17:33:04.000000000 -0500
    @@ -1393,8 +1393,8 @@
      */
     handler_rec php_handlers[] =
     {
    -    {"application/x-httpd-php", send_parsed_php},
    -    {"application/x-httpd-php-source", send_parsed_php_source},
    +    {"application/x-httpd-php5", send_parsed_php},
    +    {"application/x-httpd-php5-source", send_parsed_php_source},
         {"text/html", php_xbithack_handler},
             {"php-script", php_response_handler},
         {NULL}
    @@ -1405,7 +1405,7 @@
      */
     command_rec php_commands[] =
     {
    -    {"php_value",        php_apache_value_handler, NULL, OR_OPTIONS, TAKE2, "PHP Value Modifier"},
    +    {"php5_value",        php_apache_value_handler, NULL, OR_OPTIONS, TAKE2, "PHP Value Modifier"},
         {"phpUriHandler",        php_set_uri_handler, NULL, RSRC_CONF, TAKE1, "PHP Value Modifier"},
         {"phpUriHandlerMethod",        php_set_uri_handler_code, NULL, RSRC_CONF, TAKE1, "PHP Value Modifier"},
     #if MODULE_MAGIC_NUMBER >= 19970103
    --- php-5.1.6/sapi/apache/mod_php5.c    2006-01-06 13:06:38.000000000 -0500
    +++ php-5.1.6/sapi/apache/mod_php5.c.new    2006-02-07 15:51:31.000000000 -0500
    @@ -947,8 +947,8 @@
      */
     handler_rec php_handlers[] =
     {
    -    {"application/x-httpd-php", send_parsed_php},
    -    {"application/x-httpd-php-source", send_parsed_php_source},
    +    {"application/x-httpd-php5", send_parsed_php},
    +    {"application/x-httpd-php5-source", send_parsed_php_source},
         {"text/html", php_xbithack_handler},
         {NULL}
     };
    @@ -958,10 +958,10 @@
      */
     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_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)"},
    +    {"php5_value",        php_apache_value_handler, NULL, OR_OPTIONS, TAKE2, "PHP Value Modifier"},
    +    {"php5_flag",        php_apache_flag_handler, NULL, OR_OPTIONS, TAKE2, "PHP Flag Modifier"},
    +    {"php5_admin_value",    php_apache_admin_value_handler, NULL, ACCESS_CONF|RSRC_CONF, TAKE2, "PHP Value Modifier (Admin)"},
    +    {"php5_admin_flag",    php_apache_admin_flag_handler, NULL, ACCESS_CONF|RSRC_CONF, TAKE2, "PHP Flag Modifier (Admin)"},
         {NULL}
     };
     /* }}} */
    --- php-5.1.6/sapi/apache2filter/sapi_apache2.c    2006-01-01 07:50:18.000000000 -0500
    +++ php-5.1.6/sapi/apache2filter/sapi_apache2.c.new    2006-02-13 17:32:18.000000000 -0500
    @@ -515,7 +515,7 @@
                 apr_file_name_get(&path, ((apr_bucket_file *) b->data)->fd);
                 
                 /* Determine if we need to parse the file or show the source */
    -            if (strncmp(ctx->r->handler, "application/x-httpd-php-source", sizeof("application/x-httpd-php-source"))) { 
    +            if (strncmp(ctx->r->handler, "application/x-httpd-php5-source", sizeof("application/x-httpd-php5-source"))) { 
                     zfd.type = ZEND_HANDLE_FILENAME;
                     zfd.filename = (char *) path;
                     zfd.free_filename = 0;
    @@ -655,9 +655,9 @@
     
     static void php_insert_filter(request_rec *r)
     {
    -    int content_type_len = strlen("application/x-httpd-php");
    +    int content_type_len = strlen("application/x-httpd-php5");
     
    -    if (r->content_type && !strncmp(r->content_type, "application/x-httpd-php", content_type_len-1)) {
    +    if (r->content_type && !strncmp(r->content_type, "application/x-httpd-php5", content_type_len-1)) {
             if (r->content_type[content_type_len] == '\0' || !strncmp(r->content_type+content_type_len, "-source", sizeof("-source"))) { 
                 php_add_filter(r, r->output_filters);
                 php_add_filter(r, r->input_filters);

  3. #28

    Lightbulb

    i found that the problem for my instalation, giving me segmentation fault errors, were directly related to some config lines.

    --with-xmlrpc=shared \
    --enable-mbstring \
    --enable-mbstr-enc-trans \
    --enable-mbregex \

    i removed them, and i was able to run php5 (standalone) on my development server.

    i will give a new try to this patch, without those extensions and see what happens, i'll keep you posted.

  4. #29
    ok, i did some changes to the patch, still get segmentation fault errors.

    i think apache2 doesnt like both php's as modules.

    i will paste the patch soon, will keep doing more tests, it has to be possible.

  5. #30
    well as most of us do, I dont gave up... so decided to go for the 5.1.2 and try the patch as it was here.

    same results ppl. segmentation fault.

    [Tue Oct 31 21:48:41 2006] [notice] Apache/2.0.52 (CentOS) configured -- resuming normal operations
    [Tue Oct 31 21:49:07 2006] [notice] child pid 5091 exit signal Segmentation fault (11)
    [Tue Oct 31 21:49:15 2006] [notice] child pid 5092 exit signal Segmentation fault (11)

    so, I will not keep trying, at least for now.

    im prety sure, that if it is doable for apache 1 it has to be possible for apache2.

    i will take a little break, and join some lists on php.net to see if i can find anything else.

  6. #31
    Join Date
    Apr 2002
    Location
    Auckland - New Zealand
    Posts
    1,575
    Right now I'm playing with running php4 as a cgi under lighthttpd on port 8080 while running php5 as an apache module on 80. It seems to work OK. The next step is going to be to figure out how to set up mod_proxy to have them both working through port 80.
    You don't/shouldn't need mod_proxy and run them on different ports, just bind each web server to specific IP's onj port 80 and 443, rather than making them listen on all interfaces. That way, you just change the IP in dns to use either server and don't need to proxy anything.

  7. #32
    Has anyone had any luck with this setup for Apache 2.0.x?
    I am also getting segmentation faults (with Apache2.0.59/php4.4.6/php5.2.1).
    I haven't tried it yet with Apache 1.3.x but I don't really want to either (downgrading); it seems to me that it should also be possible to fix this for 2.0.x.
    Any pointers/tips on where to go from here?

  8. #33
    Join Date
    Dec 2002
    Location
    NJ
    Posts
    80
    Quote Originally Posted by Dotable Steve
    You don't/shouldn't need mod_proxy and run them on different ports, just bind each web server to specific IP's onj port 80 and 443, rather than making them listen on all interfaces. That way, you just change the IP in dns to use either server and don't need to proxy anything.
    I agree, give one ip dedicated to php4 and another ip dedicated to php 5. You may need two instances of apache built from source, this is similar to how alot of the control panels do it

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •