php4 and php5 white debian4

Discussion in 'Installation/Configuration' started by octopus, May 6, 2007.

  1. octopus

    octopus New Member

    hello

    In my early post of FC6 white php4 an php5 didn’t work

    I have decided to use debian 4 white php4 and followed the perfect how to.
    Than I followed the suphp white php4 and php5

    And i installed Ispconfig at the end

    now i have same problems :-(


    I Get in the apache error

    [Sun May 06 17:25:38 2007] [notice] Graceful restart requested, doing restart
    [Sun May 06 17:25:38 2007] [notice] Apache/2.2.3 (Debian) mod_ssl/2.2.3 OpenSSL/0.9.8c mod_perl/2.0.2 Perl/v5.8.8 configured -- resuming normal operations
    [Sun May 06 17:25:38 2007] [error] (9)Bad file descriptor: apr_socket_accept: (client socket)
    [Sun May 06 17:25:39 2007] [warn] long lost child came home! (pid 2652)

    Than searche (9)Bad file descriptor: apr_socket_accept: (client socket) in the forum

    The work around to change this to addhandler? But doest work for me ? and I have debian not suse

    $go_info["server"]["apache2_php"] = 'addhandler'; // 'filter' = set PHP filters, 'addtype' = Set PHP addtype or 'both' = Set Filter + Addtype, suphp = SuPHP wrapper enabled, 'addhandler' = Set PHP AddHandler (nescessary for SuSE 10.2)


    In the suphp.conf file defind this when *php is called than use php5 and when say *php4 use php4


    [handlers]
    ;Handler for php-scripts
    x-httpd-php=php4:/usr/bin/php4-cgi
    x-httpd-php=php:/usr/bin/php5-cgi

    Help …
     
  2. octopus

    octopus New Member

    Update

    Iam die hard white reinstalls hahaha

    Last night i have reinstall the server again.

    but white no ispconfig and no suphp only debian 4 white php5 and the php4

    http://www.howtoforge.com/apache2_with_php5_and_php4


    That works fine ! i can excute both :) than i install ispconfig and the first look it works but after 1 or 2 excutes i get again error

    [Sun May 06 22:59:34 2007] [error] an unknown filter was not added: PHP

    and

    [Sun May 06 22:57:49 2007] [error] (9)Bad file descriptor: apr_socket_accept: (client socket)


    but white out the suphp i get unknown filter the most
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    First, this is not an error, you can ignore this. It has nothing to do with the fact if your setup works or not. If you want to remove this warning, change PHP to addtype in the config.inc.php file in ISPConfig.

    As you did not install suphp, you can not use suphp! You will have to put the apache directives that are nescessary to run the cgi version of php in the apache directives field of the website and make sure that the checkboxes for cgi and php are not enabled for this website.
     
  4. octopus

    octopus New Member


    [​IMG]



    i have done that but no succes.

    only in the how to i put them in the apache2.conf.

    Only strange thing is that the test file for seeing which php version is running .

    that the server say that some times the file want to download or canot find the file.
     
    Last edited: May 7, 2007
  5. octopus

    octopus New Member

    When i put the addtype the error for filter is gone


    when i do than like the picture i get this


    [Mon May 07 08:39:57 2007] [notice] Graceful restart requested, doing restart
    [Mon May 07 08:39:58 2007] [notice] Apache/2.2.3 (Debian) PHP/5.2.1-0.dotdeb.2 with Suhosin-Patch mod_ssl/2.2.3 OpenSSL/0.9.8c configured -- resuming normal operations
    [Mon May 07 08:39:58 2007] [error] (9)Bad file descriptor: apr_socket_accept: (client socket)
    [Mon May 07 08:39:59 2007] [warn] long lost child came home! (pid 3744)
     
  6. octopus

    octopus New Member

    I have reinstall debian again

    Oke I have done it again the perfect debian setup version 4.
    The only thing what is different that is I installed php4-cgi white php5


    Everything is working perfect if I do test in


    When I execute in the browser the my IP/info.php (/var/www/info.php its php5)
    When I execute in the browser the my IP/info.php4 (/var/www/info.php4 its php4)


    The only thing I have not change yet is in /etc/mime.types yet

    #application/x-httpd-php phtml pht php
    #application/x-httpd-php-source phps
    #application/x-httpd-php3 php3
    #application/x-httpd-php3-preprocessed php3p#application/x-httpd-php4



    And the /etc/apache2/mods-enabled/php5.conf is not changed yet

    <IfModule mod_php5.c>
    AddType application/x-httpd-php .php .phtml .php3
    AddType application/x-httpd-php-source .phps
    </IfModule>

    Only there is /etc/apache/conf.d/php4.conf must a change this to white the # ?

    <IfModule mod_php4.c>
    AddType application/x-httpd-php .php .phtml .php3
    AddType application/x-httpd-php-source .phps
    </IfModule>

    And in the /etc/apache2.conf I put this but must this stay soo when I install ispconfig?

    AddHandler php-script .php4
    Action php-script /cgi-bin/php4


    but when i install ispconfig its not working
     
    Last edited: May 7, 2007
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    1) Comment out the addtype lines in the php5.conf file and the php4.conf file.

    2)
    No, please comment this out.

    3a) If you want to enable php5 in a website, enable the php checkbox in ISPConfig for this website.

    3b) If you want to enable php4 for the website, make sure that the php checkbox and the cgi checkbox are not enabled. Then add the following lines in the aoache directives field:

    AddHandler php-script .php
    Action php-script /cgi-bin/php4

    Now all files ending with .php are executed by php4 and not php5.
     
  8. octopus

    octopus New Member

    I have now same proble again ......


    php 5 works fine


    only when vink out the

    CGI Scripts:
    Standard CGIs:
    PHP Scripts:

    and put by the Apache Directives (Optional): the

    AddHandler php-script .php
    Action php-script /cgi-bin/php4

    it give file not found and error 404
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Please post the exact error message from the http error log of this website.
     
  10. octopus

    octopus New Member

    [Tue May 08 22:14:19 2007] [notice] Graceful restart requested, doing restart
    [Tue May 08 22:14:19 2007] [error] (9)Bad file descriptor: apr_socket_accept: (client socket)
    [Tue May 08 22:14:19 2007] [notice] Apache/2.2.3 (Debian) PHP/5.2.0-8+etch3 mod_ssl/2.2.3 OpenSSL/0.9.8c configured -- resuming normal operations
    [Tue May 08 22:14:20 2007] [warn] long lost child came home! (pid 9277)

    Hello till this is the apache error log
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    Please have a look at the apache error log of the website, not the main apache error log. The error log of the website is in the log directory in the website.
     
  12. octopus

    octopus New Member

    Hmmmmm missing file ??? must each website in the cgi-bin need a php4 file?


    [Tue May 08 22:30:40 2007] [error] [client 192.168.20.23] File does not exist: /var/www/web1/web/cgi-bin
    [Tue May 08 22:30:40 2007] [error] [client 192.168.20.23] File does not exist: /var/www/web1/web/cgi-bin
    [Tue May 08 22:30:40 2007] [error] [client 192.168.20.23] File does not exist: /var/www/web1/web/cgi-bin
    [Tue May 08 22:30:40 2007] [error] [client 192.168.20.23] File does not exist: /var/www/web1/web/cgi-bin
     
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    No. There are two solutions for this problem.

    1) Enable the cgi checkbox for this website and then create a symlink with the name php in the cgi-bin directory of the website (which is in the website root, not inside the web directory as /var/www/web1/web/cgi-bin is virtually mapped to this directory) which points to php cgi binary.

    2) You create a global alias for the cgi-bin directory and place the symlink for php there, so you dont have to create the symlink for every website manually.

    But 2) is normally created automatically by debian, so I wonder why it does not work for you as you said that it worked as you added the addtype and action is the apache configuration directly. maybe you activated suexec in your apache which prevents access to the global cgi directory.
     
  14. octopus

    octopus New Member

    the only thing i activate is this in apache?

    a2enmod ssl
    a2enmod rewrite
    a2enmod suexec
    a2enmod include

    how create a vrituale mapping to cgi-bin?
     
  15. nightfreak

    nightfreak New Member

    i have exactly the same problem and created a ScriptAlias called "cgi-bin" that points to "/usr/bin". this is my configuration:

    Code:
    ScriptAlias /cgi-bin "/usr/bin"
    <Directory "/usr/bin">
            AllowOverride None
            Options +ExecCGI +FollowSymLinks
            Order allow,deny
            Allow from all
    </Directory>
    
    AddHandler php-script .php4
    Action php-script /cgi-bin/php4-cgi
    The 404 errors are gone now, but i still doesn't work, i get the following error now:
    Code:
    Warning: Unexpected character in input: '' (ASCII=8) state=1 in /usr/bin/php4-cgi on line 977
    
    Warning: Unexpected character in input: '' (ASCII=7) state=1 in /usr/bin/php4-cgi on line 977
    
    Warning: Unexpected character in input: ' in /usr/bin/php4-cgi on line 978
    
    Parse error: syntax error, unexpected '?' in /usr/bin/php4-cgi on line 978
     
  16. falko

    falko Super Moderator Howtoforge Staff

    Is there maybe a syntax error in your PHP script?
     
  17. nightfreak

    nightfreak New Member

    The script has no syntax error, its a simple phpinfo() script.

    Why is it so difficult to install to get php4-cgi running, with or without fastcgi? I tried a lot of howtos, but none seemed to work. i'm running apache mpm prefork with mod_php5.
     
  18. till

    till Super Moderator Staff Member ISPConfig Developer

    I had similar script errors in one installation. It was related to the php4 binary. Just as a test, please try to install php5-cgi (you dont have to remove mod_php5 for this) and then replace the line:

    AddHandler php-script .php4
    Action php-script /cgi-bin/php4-cgi

    with:

    AddHandler php-script .php5
    Action php-script /cgi-bin/php5-cgi

    in your configuration and test if .php5 files work as cgi.
     
  19. nightfreak

    nightfreak New Member

    php5-cgi works! Any idea what wrong? I would like to avoid recompiling php4-cgi.
     
  20. falko

    falko Super Moderator Howtoforge Staff

    Do you need PHP4? Because otherwise I'd suggest you go with PHP5.
     

Share This Page