Re: PHP suddenly stops working on FreeBSD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday 10 May 2006 16:58, Paul Waring wrote:
> I restarted Apache this morning in order to allow some new virtual
> hosts to be recognised, and now I've got a problem whereby all of my
> PHP scripts are being served up as source code instead of being
> executed by the web server. I don't know why this is, as far as I'm
> aware I haven't changed anything PHP-related for a while and
> everything was running fine until this morning. Running
>
> grep php /usr/local/etc/apache2/httpd.conf
>
> Gives me:
>
> #LoadModule php4_module        libexec/apache2/libphp4.so

If PHP isn't loaded, PHP scripts will not be recognized by Apache as such, but 
will be regarded as regualr files. The above line must be uncommented either 
directly in httpd.conf or in an included file.

If liphp4.so cannot be found, you have to create it by compiling from source 
or restoring from an installation medium.

Addype directive instructs Apache that files ending in .php will be handled 
differently. Alas the handler (i.e. PHP interpreter) is not loaded 
(commented-out LoadModule directive) so Apache ends up serving .php files as 
is.

-Stathis

> DirectoryIndex index.html index.htm index.php
> #AddType application/x-httpd-php .php
> AddType application/x-httpd-php .php
> AddType application/x-httpd-php-source .phps
>
> So there's definitely an AddType directive for PHP scripts. If I
> uncomment the LoadModule line I get the error:
>
> Cannot load /usr/local/libexec/apache2/libphp4.so into server: Cannot
> open "/usr/local/libexec/apache2/libphp4.so"
>
> But I think that line has always been uncommented (and libphp4.so
> doesn't exist anywhere on the machine). I've tried rebuilding PHP, but
> it hasn't made any difference.
>
> Does anyone have any ideas as to what might have gone wrong? I'm at a
> loss as to how things could suddenly have broken when they were
> working fine before.
>
> Some version numbers in case it helps:
>
> php -v
> PHP 4.4.2 (cli) (built: May 10 2006 14:40:03)
> Copyright (c) 1997-2006 The PHP Group
> Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
>
> httpd -v
> Server version: Apache/2.0.58
> Server built:   May  7 2006 10:42:02
>
> Thanks in advance,
>
> Paul
>
> --
> Data Circle
> http://datacircle.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux