如何通过.htaccess配置本地构建的php作为CGI?

i have no root priority, so i cannot the system level PHP environment, so i build a php installation to my home directory, that is /home/meow/build/

then i add the following lines to .htaccess:

AddHandler php-handler .php
Action php-handler "/home/meow/doaminname/cgi-bin"

that cgi-bin is in fact a script, the contents in it is:

    exec "/home/meow/build/bin/php-cgi" $@

when i try to visit domainname/a.php, the error message is:

The requested URL /home/meow/cgi-bin/p.php was not found on this server

what's wront?

The Action directive wants a URL-path, not a file-path. That means your cgi-bin needs to be inside your site's document root, and the Action directive points to it via a path relative to the document root.

Without knowing how you have your document root setup, I'm going to guess you want something like:

Action php-handler "/cgi-bin"

That being you can access the same script via http://yourdomain.com/cgi-bin.