简体   繁体   中英

.htaccess - execute PHP in .html files on FastCGI

I'm using PHP with FastCGI and I have the following problem. I know the command for .htaccess:

AddHandler fcgid-script .html
FcgidWrapper /path/to/php-fastcgi.fcgi .html

...but I don't know to what path the FcgidWrapper should point. To which file or directory should it point, and where is it usually?

Thanks!

you can try this

<IfModule mod_fcgid.c>
<Files ~ (\.html)>
    SetHandler fcgid-script
    FCGIWrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper .html
    Options +ExecCGI
    allow from all
</Files>

The path you are asking for is system dependent, so only your sys-admin will be able to answer that question. You should probably just rename your html files with php in them to use the php extension. Sending html files without php in them to fcgi is wasteful.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM