Php.cgi parse error

software development

#1

When POSTing to a PHP page (that worked beautifully on another server) I get the following:

Warning: Unexpected character in input: ‘’ (ASCII=15) state=1 in /usr/local/dh/cgi-system/php.cgi on line 4118

Parse error: parse error, unexpected ‘*’ in /usr/local/dh/cgi-system/php.cgi on line 4118

And the URL is redirected to:
http://jscottkelley.com/cgi-system/php.cgi

I’ve never received an error message to the like before (usually the parse error specified the .php file and line number). Is this just telling me something is screwy somewhere with my php page? I just find the message a little esoteric and am not certain where to begin troubleshooting. Thanks.
-Jonathan


#2

Can you show us your PHP?


Simon Jessey
Keystone Websites | si-blog


#3

Sounds like you’re accessing the php binary directly.

The wrapper will not work unless there’s a file being passed through it. You cannot call the binary itself directly. You must use it as a wrapper to a PHP script.


#4

thanks for your suggestion.

it turns out that i was posting to the /cgi-system/php.cgi file directly from the form.

clearly, it was not my intention to do this, but rather what happened was that the PHP variable $_SERVER[‘SCRIPT_NAME’] used the aforementioned php.cgi file instead of my actual script name (probably due to how PHP is being executed). I hard-coded the script name and everything is groovy.

Thanks guys!


#5

$_SERVER[‘PHP_SELF’] always worked for me.