php malformed header from script

Collins Richey crichey
Sat Feb 18 11:32:04 PST 2006


On 2/18/06, Ronnie Gauthier <ronnieg at chartermi.net> wrote:
> On Sat, 18 Feb 2006 10:02:50 -0500
> "David Bandel" <david.bandel at gmail.com> wrote:
>
> > Folks,
> >
> > OK, all you PHP lovers out there.  When I run a php script with apache I get:
> >  malformed header from script. Bad header=Launching... (script name)
> >
> > If I run php ./phpscript.php from a command line it works.  So I must
> > have something hosed in my apache setup.  It wants to execute the php,
> > so that part is right.  I also allow ExecCGI Includes FollowSymLinks.
> >
> > Any ideas?
> >
>
> If you have php compiled as a cgi then it is probably that apache
> expects to be able to send its own headers. So if you do this
> header ("http/ blah blah") you get an error
> replace the http with status
> header ("status: blah blah")
>

Not many run php as cgi under apache, since there's a more direct
route. With my debian (ie Ubuntu) system all that's necessary is the
following (set automagically by the package installation). Yours could
be php4, of course.

/etc/apache2/apache2.conf
...
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml

...
and
/etc/apache2/mods-enabled/php5.conf & ...php5.load (symlinks to
/etc/apache2/mods-available/...)

php5.load contains
LoadModule php5_module /usr/lib/apache2/modules/libphp5.so

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

And it just works (tm).

HTH,

--
Collins Richey
      The agnostic dyslexic insomniac lies awake wondering if there is a dog.



More information about the Linux-users mailing list