PHP problems in Apache - BSD

This is a discussion on PHP problems in Apache - BSD ; After a previous CVSup, installed, from ports, the following in my FreeBSD-6.1 box, apache-2.2.4 php5-5.2.1_3 (with options: CGI, APACHE, SUHOSIN, IPV6, REDIRECT, FASTCGI and PATHINFO) php5-extensions 1.1 (with options: CALENDAR, CTYPE, DBA, DOM, FILEINFO, FILTER and FTP) Installation of 3 ...

+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 20 of 27

Thread: PHP problems in Apache

  1. PHP problems in Apache

    After a previous CVSup, installed, from ports, the following in my FreeBSD-6.1 box,
    apache-2.2.4
    php5-5.2.1_3 (with options: CGI, APACHE, SUHOSIN, IPV6, REDIRECT, FASTCGI and PATHINFO)
    php5-extensions 1.1 (with options: CALENDAR, CTYPE, DBA, DOM, FILEINFO, FILTER and FTP)

    Installation of 3 ports ended normally, with no errors.
    Added following lines in httpd.conf,
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
    ServerName 127.0.0.1
    LoadModule php5_module libexec/apache22/libphp5.so // Already added by php5 install
    Created php.ini. Just copied from 'php.ini-recommended'.

    Runing the 'apachectl configtest' command I get a 'Syntax OK'.
    Finally, when trying to start Apache I get the following,
    Jove# /usr/local/sbin/apachectl start
    [Tue Mar 13 12:21:49 2007] [warn] (2)No such file or directory: Failed to enable the
    'httpready' Accept Filter
    Needless to say that Apache fails to start.

    Any help or hint in the right direction is welcomed.

    -- Julio



  2. Re: PHP problems in Apache

    Julio Uehara wrote in
    news:et572e01eje@news3.newsguy.com:

    > After a previous CVSup, installed, from ports, the following in my
    > FreeBSD-6.1 box,
    > apache-2.2.4
    > php5-5.2.1_3 (with options: CGI, APACHE, SUHOSIN, IPV6, REDIRECT,
    > FASTCGI and PATHINFO) php5-extensions 1.1 (with options: CALENDAR,
    > CTYPE, DBA, DOM, FILEINFO, FILTER and FTP)
    >
    > Installation of 3 ports ended normally, with no errors.
    > Added following lines in httpd.conf,
    > AddType application/x-httpd-php .php
    > AddType application/x-httpd-php-source .phps
    > ServerName 127.0.0.1
    > LoadModule php5_module libexec/apache22/libphp5.so // Already
    > added by php5 install
    > Created php.ini. Just copied from 'php.ini-recommended'.
    >
    > Runing the 'apachectl configtest' command I get a 'Syntax OK'.
    > Finally, when trying to start Apache I get the following,
    > Jove# /usr/local/sbin/apachectl start
    > [Tue Mar 13 12:21:49 2007] [warn] (2)No such file or directory:
    > Failed to enable the 'httpready' Accept Filter
    > Needless to say that Apache fails to start.
    >
    > Any help or hint in the right direction is welcomed.
    >
    > -- Julio
    >
    >
    >


    Hello Julio,
    This is just a warning, the apache app should still load up.
    Try doing a sockstat -4l and see if it's listening on localhost

    -Chris

  3. Re: PHP problems in Apache

    cpet wrote:
    > Hello Julio,
    > This is just a warning, the apache app should still load up.
    > Try doing a sockstat -4l and see if it's listening on localhost
    >
    > -Chris


    Hello Chris,

    Jove# /usr/local/sbin/apachectl start
    [Tue Mar 13 15:10:25 2007] [warn] (2)No such file or directory: Failed to enable the 'httpready' Accept Filter
    Jove# sockstat -4l
    USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS
    root sshd 504 4 tcp4 *:22 *:*
    root sendmail 459 3 tcp4 127.0.0.1:25 *:*
    root syslogd 362 7 udp4 *:514 *:*

    Looks like httpd is not running. Also checked with ps -ax command.

    -- Julio



  4. Re: PHP problems in Apache

    Julio Uehara wrote:
    [snip]
    > [Tue Mar 13 12:21:49 2007] [warn] (2)No such file or directory: Failed to
    > [enable the
    > 'httpready' Accept Filter
    > Needless to say that Apache fails to start.
    >
    > Any help or hint in the right direction is welcomed.
    >
    > -- Julio


    The default is supposed to include a "not" section at the bottom of
    httpd.conf, something like:

    Include etc/apache22/Includes/*.conf <= and there is suppsoed to be a .conf
    to turn off httpready Accept.

    However, on FreeBSD you can have better performance by taking advantage of
    it. There is a kld module for this filter, as well as a second one for
    https traffic. Since I don't use https I only load the one
    in /boot/loader.conf like this:

    accf_http_load="YES"



    Then in my httpd.conf is this:

    #Listen 12.34.56.78:80
    Listen 80

    AcceptFilter http httpready
    #AcceptFilter https dataready
    #AcceptFilter https none

    -Jason


  5. Re: PHP problems in Apache

    Julio Uehara wrote in
    news:et5fmn022j9@news3.newsguy.com:

    > cpet wrote:
    >> Hello Julio,
    >> This is just a warning, the apache app should still load up.
    >> Try doing a sockstat -4l and see if it's listening on localhost
    >>
    >> -Chris

    >
    > Hello Chris,
    >
    > Jove# /usr/local/sbin/apachectl start
    > [Tue Mar 13 15:10:25 2007] [warn] (2)No such file or directory: Failed
    > to enable the 'httpready' Accept Filter Jove# sockstat -4l
    > USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN
    > ADDRESS root sshd 504 4 tcp4 *:22
    > *:* root sendmail 459 3 tcp4 127.0.0.1:25 *:*
    > root syslogd 362 7 udp4 *:514 *:*
    >
    > Looks like httpd is not running. Also checked with ps -ax command.
    >
    > -- Julio
    >
    >
    >


    Julio,
    try removing the lines which start those accept filters.

    -Chris

  6. Re: PHP problems in Apache

    cpet wrote:
    > Julio,
    > try removing the lines which start those accept filters.
    >
    > -Chris


    To prevent those filters to start, added following line in httpd.conf,
    'AcceptFilter http none'

    Then did as follows,
    Jove# /usr/local/sbin/apachectl configtest
    Syntax OK
    Jove# /usr/local/sbin/apachectl start
    Jove#

    No errors, but httpd fails to start. Checked as follows,

    Jove# sockstat -4l
    USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS
    root sshd 504 4 tcp4 *:22 *:*
    root sendmail 459 3 tcp4 127.0.0.1:25 *:*
    root syslogd 362 7 udp4 *:514 *:*

    'ps -ax' and 'top' confirm no httpd running.

    -- Julio



  7. Re: PHP problems in Apache

    Jason Bourne wrote:
    > The default is supposed to include a "not" section at the bottom of
    > httpd.conf, something like:
    >
    > Include etc/apache22/Includes/*.conf <= and there is suppsoed to be a .conf
    > to turn off httpready Accept.
    >
    > However, on FreeBSD you can have better performance by taking advantage of
    > it. There is a kld module for this filter, as well as a second one for
    > https traffic. Since I don't use https I only load the one
    > in /boot/loader.conf like this:
    >
    > accf_http_load="YES"
    >
    >
    >
    > Then in my httpd.conf is this:
    >
    > #Listen 12.34.56.78:80
    > Listen 80
    >
    > AcceptFilter http httpready
    > #AcceptFilter https dataready
    > #AcceptFilter https none
    >
    > -Jason
    >

    In /boot/loader.conf added,
    accf_http_load="YES"

    In httpd.conf added,
    AcceptFilter httpd httpdready

    After restarting, did:
    Jove# /usr/local/sbin/apachectl configtest
    Syntax OK
    Jove# /usr/local/sbin/apachectl start
    Jove# sockstat -4l
    USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS
    root sshd 504 4 tcp4 *:22 *:*
    root sendmail 459 3 tcp4 127.0.0.1:25 *:*
    root syslogd 362 7 udp4 *:514 *:*
    Jove#

    No error message this time, but apache fails to start.

    -- Julio



  8. Re: PHP problems in Apache

    Julio Uehara wrote:
    > Any help or hint in the right direction is welcomed.


    echo 'apache22_enable="YES"' >> /etc/rc.conf
    /usr/local/etc/rc.d/apache22 start

  9. Re: PHP problems in Apache

    Pertti Kosunen wrote:
    > echo 'apache22_enable="YES"' >> /etc/rc.conf
    > /usr/local/etc/rc.d/apache22 start


    In /etc/rc.conf added:
    apache22_enable="YES"
    Then:
    Jove# /usr/local/etc/rc.d/apache22 start
    Performing sanity check on apache22 configuration:
    Syntax OK
    Starting apache22.
    Jove# sockstat -4l
    USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS
    root sshd 512 4 tcp4 *:22 *:*
    root sendmail 467 3 tcp4 127.0.0.1:25 *:*
    root syslogd 370 7 udp4 *:514 *:*
    Jove#
    Top and ps -ax confirms the same.

    -- Julio



  10. Re: PHP problems in Apache

    Julio Uehara wrote:
    > Top and ps -ax confirms the same.


    What say /var/log/httpd-error.log?

  11. Re: PHP problems in Apache

    Pertti Kosunen wrote:
    > Julio Uehara wrote:
    >> Top and ps -ax confirms the same.

    >
    > What say /var/log/httpd-error.log?


    [Fri Mar 16 18:03:14 2007] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
    [Fri Mar 16 18:03:14 2007] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of "Jove.discovery.net"
    Configuration Failed

    Directives in httpd.conf, believed to be related to above messages:
    No SSLSessionCache directives were found.
    Listen 80 // Listen 127.0.0.1:80 makes no difference
    ServerName 127.0.0.1:80

    -- Julio



  12. Re: PHP problems in Apache

    Julio Uehara wrote:
    > ServerName 127.0.0.1:80


    Try 'ServerName localhost:80'.

  13. Re: PHP problems in Apache

    Begin
    On 2007-03-16, Julio Uehara wrote:
    > [Fri Mar 16 18:03:14 2007] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of "Jove.discovery.net"
    > Configuration Failed


    That name doesn't exist. I doubt discover.net is yours. If not, don't
    use it. Misconfigurations like this can cause nasty and hard to diagnose
    trouble, not to mention being rude to whoever did register it.

    Register your own domain or use something that can't be registered, like
    discovery.local. You would have to serve up your own forward and reverse
    zone, but setting up DNS correctly is part and parcel of running your
    own network, really.

    For the direct problem: fix the naming issue is step one. Step two is a
    bit of RTFM; the apache manual does explain what this naming stuff in
    apache is all about.

    If you also want to do port forwarding on your local network from the
    outside AND use ssl, you're in for a lot more fun. But getting it to
    work for just your local network first is a good start and it looks like
    you need the excercise.


    --
    j p d (at) d s b (dot) t u d e l f t (dot) n l .
    This message was originally posted on Usenet in plain text.
    Any other representation, additions, or changes do not have my
    consent and may be a violation of international copyright law.

  14. Re: PHP problems in Apache

    Pertti Kosunen wrote:
    > Try 'ServerName localhost:80'.


    Tried this one, but same message in httpd-error.log,
    [Sat Mar 17 10:06:29 2007] [warn] Init: Session Cache is not configured [hint:
    SSLSessionCache]
    [Sat Mar 17 10:06:29 2007] [alert] (EAI 8)hostname nor servname provided, or
    not known: mod_unique_id: unable to find IPv4 address of "Jove.discovery.local"

    Also tried, 'ServerName 192.168.1.xxx', where 192.168.1.xxx is address obtained
    via DHCP, but same message.

    -- Julio



  15. Re: PHP problems in Apache

    jpd wrote:
    > That name doesn't exist. I doubt discover.net is yours. If not, don't
    > use it. Misconfigurations like this can cause nasty and hard to diagnose
    > trouble, not to mention being rude to whoever did register it.
    >
    > Register your own domain or use something that can't be registered, like
    > discovery.local. You would have to serve up your own forward and reverse
    > zone, but setting up DNS correctly is part and parcel of running your
    > own network, really.
    >
    > For the direct problem: fix the naming issue is step one. Step two is a
    > bit of RTFM; the apache manual does explain what this naming stuff in
    > apache is all about.
    >
    > If you also want to do port forwarding on your local network from the
    > outside AND use ssl, you're in for a lot more fun. But getting it to
    > work for just your local network first is a good start and it looks like
    > you need the excercise.
    >

    You are right jpd. Domain changed to 'discovery.local'.
    You mention a lot of stuff that are still over my head. I hope to get that
    knowledge some day.
    Thank you.

    -- Julio



  16. Re: PHP problems in Apache

    Begin
    On 2007-03-17, Julio Uehara wrote:
    > You mention a lot of stuff that are still over my head. I hope to get that
    > knowledge some day.


    You at least have the topics to search for. :-)

    Find a DNS howto and learn how to serve names for your discovery.local
    and reverse lookups for the local private network, to get started.


    --
    j p d (at) d s b (dot) t u d e l f t (dot) n l .
    This message was originally posted on Usenet in plain text.
    Any other representation, additions, or changes do not have my
    consent and may be a violation of international copyright law.

  17. Re: PHP problems in Apache

    Julio Uehara wrote:
    > not known: mod_unique_id: unable to find IPv4 address of "Jove.discovery.local"


    echo '128.0.0.1 jove jove.discovery.local' >> /etc/hosts

    (Ugly hack)

  18. Re: PHP problems in Apache

    Begin
    On 2007-03-17, Pertti Kosunen wrote:
    > Julio Uehara wrote:
    >> not known: mod_unique_id: unable to find IPv4 address of "Jove.discovery.local"

    >
    > echo '128.0.0.1 jove jove.discovery.local' >> /etc/hosts


    That looks like a mis-spelled 127.0.0.1 to me.


    --
    j p d (at) d s b (dot) t u d e l f t (dot) n l .
    This message was originally posted on Usenet in plain text.
    Any other representation, additions, or changes do not have my
    consent and may be a violation of international copyright law.

  19. Re: PHP problems in Apache

    Pertti Kosunen wrote:
    > echo '128.0.0.1 jove jove.discovery.local' >> /etc/hosts
    >
    > (Ugly hack)

    The ugly hack (with 127) really did the trick!. Now 'httpd-error.log' says:
    [Sun Mar 18 08:34:12 2007] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
    [Sun Mar 18 08:34:14 2007] [notice] Digest: generating secret for digest authentication ...
    [Sun Mar 18 08:34:14 2007] [notice] Digest: done
    [Sun Mar 18 08:34:15 2007] [notice] Apache/2.2.4 (FreeBSD) mod_ssl/2.2.4 OpenSSL/0.9.7e-p1 DAV/2 PHP/5.2.1 with Suhosin-Patch configured -- resuming normal operations

    To check it, with browser opened '/usr/local/www/apache22/data/index.html'
    and got the "It works!" display.

    For PHP testing, created php script 'test.php' with the following simple
    script to display date:
    echo date("H:i, jS F");
    ?>
    It displayed a blank page when opened with browser. Looking at the 'page
    source', the above php script is displayed, meaning that php is not working.

    -- Julio



  20. Re: PHP problems in Apache

    Julio Uehara wrote:
    > To check it, with browser opened '/usr/local/www/apache22/data/index.html'
    > and got the "It works!" display.
    >
    > For PHP testing, created php script 'test.php' with the following simple
    > script to display date:
    > > echo date("H:i, jS F");
    > ?>


    Correction. I should have said:
    To check it, pointed browser to 'http://localhost' and got the "It works!"
    display. It also worked with 'http://127.0.0.1'

    For PHP, pointed browser to 'htpp://localhost/test.php'

    Forgot about the following:
    %sockstat -4l
    USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS
    www httpd 689 3 tcp46 *:80 *:*
    www httpd 689 4 tcp4 *:* *:*
    www httpd 571 3 tcp46 *:80 *:*
    www httpd 571 4 tcp4 *:* *:*
    www httpd 570 3 tcp46 *:80 *:*
    www httpd 570 4 tcp4 *:* *:*
    www httpd 569 3 tcp46 *:80 *:*
    www httpd 569 4 tcp4 *:* *:*
    www httpd 568 3 tcp46 *:80 *:*
    www httpd 568 4 tcp4 *:* *:*
    www httpd 567 3 tcp46 *:80 *:*
    www httpd 567 4 tcp4 *:* *:*
    root sshd 507 4 tcp4 *:22 *:*
    root httpd 488 3 tcp46 *:80 *:*
    root httpd 488 4 tcp4 *:* *:*
    root syslogd 362 7 udp4 *:514 *:*

    %top
    [snip]
    570 www 1 4 0 13032K 9160K accept 0:00 0.00% httpd
    571 www 1 4 0 13032K 9160K accept 0:00 0.00% httpd
    567 www 1 4 0 13028K 9064K accept 0:00 0.00% httpd
    568 www 1 4 0 13028K 9064K accept 0:00 0.00% httpd
    [snip]

    %ps -ax
    [snip]
    567 ?? I 0:00.01 /usr/local/sbin/httpd -DNOHTTPACCEPT
    568 ?? I 0:00.01 /usr/local/sbin/httpd -DNOHTTPACCEPT
    569 ?? I 0:00.00 /usr/local/sbin/httpd -DNOHTTPACCEPT
    570 ?? I 0:00.01 /usr/local/sbin/httpd -DNOHTTPACCEPT
    571 ?? I 0:00.01 /usr/local/sbin/httpd -DNOHTTPACCEPT
    689 ?? I 0:00.00 /usr/local/sbin/httpd -DNOHTTPACCEPT
    [snip]

    -- Julio



+ Reply to Thread
Page 1 of 2 1 2 LastLast