Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse error & unexpected character in phpinfo ? 1

Status
Not open for further replies.

Xaqte

IS-IT--Management
Oct 4, 2002
971
US
I'm trying to run php4 cgi script that only contains:
Code:
<?php
phpinfo();
?>

It runs fine when I call it from terminal or command line... no errors. However, when I call it from the browser I get the following error:

Warning: Unexpected character in input: " (ASCII=19) state=1 in /usr/bin/php4-cgi on line 2353

Parse error: parse error, unexpected '*' in /usr/bin/php4-cgi on line 2353

Apache info that may be relevent:
Code:
AddHandler php-script .php
ScriptAlias /cgi-bin/ /usr/bin/
Action php-script /cgi-bin/php4-cgi

Any thoughts/experience would greatly be appreciated!

Thanks,

X
 
I'm mostly guessing here (and only have thoughts no solutions)... but the reason it works fine from the command line is you're just running the PHP interpretter that one... your issue seems to be in the php4-cgi handler.

The first thing I'd say is have you considered running it as an Apache module instead? It's significantly faster, and you shouldn't run into these issues.

The second thing is, this is a problem with the php4 install... did you compile it, is it a package (if so where'd you get it), and what's your OS?

I'm guessing a re-install is your easiest fix, but depending on those details it's going to depend what your best route is, if you're running something like debian unstable you may have just snagged a bad package (in my experience very few people run php as a cgi anymore, so it's not surprising something like that could slip through)...
 
skiflyer, thanks for the response!

You were right... I was calling the wrong binary in my apache conf.

My updated Apache info:
Code:
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
AddHandler php4-script .php
Action php4-script /cgi-bin/php4

I'm already running php5 as a module & I wanted to have two different versions available for development testing.

Thanks,

X

BTW - OS is Ubuntu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top