PHP problems in Apache - BSD

This is a discussion on PHP problems in Apache - BSD ; jpd wrote: > 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. Thanks for the guidance jpd. -- Julio...

+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 21 to 27 of 27

Thread: PHP problems in Apache

  1. Re: PHP problems in Apache

    jpd wrote:
    > 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.


    Thanks for the guidance jpd.

    -- Julio



  2. Re: PHP problems in Apache

    Julio Uehara wrote:
    > The ugly hack (with 127) really did the trick!. Now 'httpd-error.log' says:


    Yes, 127... of course. This is to get around missing dns entry. Better
    way might be to run BIND locally.

    http://www.freebsd.org/doc/en_US.ISO...twork-dns.html

    > 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.


    ' short open tags from php.ini.

  3. Re: PHP problems in Apache

    Julio Uehara wrote:
    [snip]
    > 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.


    In the DSO module section of your httpd.conf make sure you have a line like
    this:

    LoadModule php5_module libexec/apache22/libphp5.so

    The PHP install should have already placed it there. I doesn't hurt to add
    the second entry here (you'll want it later):


    DirectoryIndex index.html index.php


    And the all important needs to be in the section:

    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps

    Do apachectl restart to reload the config changes.

    Also a good PHP test is this:

    echo phpinfo();
    ?>

    It will return lots of usefule info when PHP is working.

    -Jason


  4. Re: PHP problems in Apache

    Jason Bourne wrote:
    > In the DSO module section of your httpd.conf make sure you have a line like
    > this:
    >
    > LoadModule php5_module libexec/apache22/libphp5.so
    >

    Yes, it is already there. The PHP install put it there.

    > The PHP install should have already placed it there. I doesn't hurt to add
    > the second entry here (you'll want it later):
    >
    >
    > DirectoryIndex index.html index.php
    >

    >

    Copied this. Will have it in reserve. But, php scripts are alredy executed
    without it being present.

    > And the all important needs to be in the section:
    >
    > AddType application/x-httpd-php .php
    > AddType application/x-httpd-php-source .phps
    >

    Already there.

    > Do apachectl restart to reload the config changes.
    >
    > Also a good PHP test is this:
    >
    > > echo phpinfo();
    > ?>
    >
    > It will return lots of usefule info when PHP is working.
    >

    This was really good!
    > -Jason
    >

    Thank you Jason

    -- David Webb ;-)



  5. Re: PHP problems in Apache

    Pertti Kosunen wrote:
    > Yes, 127... of course. This is to get around missing dns entry. Better
    > way might be to run BIND locally.
    > http://www.freebsd.org/doc/en_US.ISO...twork-dns.html

    Thank you. Will certainly have a look at it.

    > ' > short open tags from php.ini.

    Congratulations Pertti!, you solved my PHP problem in Apache. Many thanks.
    My thanks to Chris and Jason, too. Learnt some usefull things from them too.

    Two problems still remain,
    - Session Cache configuration [SSLSessionCache]
    - Sendmail seems to have been nuked by apache being enabled.

    Second message in this thread, shows sendmail running:
    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 :

    Now, same command reports httpd running instead of sendmail:
    %sockstat -4l
    USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS
    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 *:*

    Messages at startup of FreeBSD box, show this abnormality, which is also
    logged in /var/log/mailog and /var/log/messages:
    Mar 19 16:51:18 Jove sm-mta[458]: NOQUEUE: SYSERR(root): host "localhost" unknown: Invalid argument
    Mar 19 16:51:18 Jove sm-msp-queue[461]: starting daemon (8.13.6): queueing@00:30:00

    These are different problems that deserve the opening of new threads.

    Thank you once again.

    -- Julio



  6. Re: PHP problems in Apache

    Julio Uehara wrote:
    > - Sendmail seems to have been nuked by apache being enabled.
    >
    > Messages at startup of FreeBSD box, show this abnormality, which is also
    > logged in /var/log/mailog and /var/log/messages:


    My mistake in commenting out the first 2 lines below (/etc/hosts), when
    third line was introduced at Pertti's advice (Ugly hack),

    ::1 localhost localhost.my.domain
    127.0.0.1 localhost localhost.my.domain
    127.0.0.1 jove jove.discovery.local

    As shown, uncommented, got no more error messages at startup and had
    sendmail running, together with httpd,

    %sockstat -4l

    USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS
    www httpd 573 3 tcp46 *:80 *:*
    www httpd 573 4 tcp4 *:* *:*
    www httpd 572 3 tcp46 *:80 *:*
    www httpd 572 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 *:* *:*
    root sshd 509 4 tcp4 *:22 *:*
    root httpd 490 3 tcp46 *:80 *:*
    root httpd 490 4 tcp4 *:* *:*
    root sendmail 459 3 tcp4 127.0.0.1:25 *:*
    root syslogd 362 7 udp4 *:514 *:*

    -- Julio



  7. Re: PHP problems in Apache

    Julio Uehara wrote:
    > ::1 localhost localhost.my.domain
    > 127.0.0.1 localhost localhost.my.domain
    > 127.0.0.1 jove jove.discovery.local
    >

    It works but doesn't look good. After checking, trimmed lines above to:
    '127.0.0.1 localhost jove.discovery.local jove'



+ Reply to Thread
Page 2 of 2 FirstFirst 1 2