Hello, I'm running php as a cgi. This way I can use the suexec wrapper.

The thing is.. with #!/path/to/binary at the top of each script, I can't use cookies or sessions, because it conflicts with the headers.

I have this in my vhost (and obviously isn't working):

AddType application/x-httpd-php .php
ScriptAlias /php/ "/usr/local/php-shell/"
Action application/x-httpd-php /bin/php

path to binary is /usr/local/php-shell/bin/php

This is in error_log:

script not found or unable to stat: /usr/local/php-shell/test.php

But the script DOES work with the #!/path/to/binary at the top. I need to get it to work withOUT it, for sessions/cookies.

Help much appreciated

Thanks 🙂

    Well, on the one hand, try going ahead and giving the rest of the path in httpd.conf or .htaccess (include the bin dir in your ScriptAlias directive...)

    OTOH, would ob_start() help you here?

      hmmm....i'm not sure ob_start() will work in this case, i may be wrong, but IME you have to have session_start() before the ob_start() so i think in this case he may have some problems

      OTOH, i don't use php as cgi, so i am not 100%, surely there is an easier way to use sessions when you need to do the Perl-like bin call

        Which begs the ?original? question, does he need to include the #/shell/name line at all, or can he just do it via AddHandler & ScriptAlias in httpd.conf?

        /me wishes I were smart...

          Write a Reply...