น้อมรำลึกในพระมหากรุณาธิคุณ และร่วมถวายความอาลัย สมเด็จพระนางเจ้าสิริกิติ์ พระบรมราชินีนาถ พระบรมราชชนนีพันปีหลวง เสด็จสวรรคต ด้วยสำนึกในพระมหากรุณาธิคุณหาที่สุดมิได้
075-845-490 | 097-165-2449
Line ID: @hostnakhonitech
🎉 โปรโมชั่นพิเศษ! ลด 10% สำหรับลูกค้าใหม่
NakhoniTech
075-845-490
support@NakhoniTech.com

วิธีเขียนโค้ด php ใน ไฟล์นามสกุล html How to perform PHP code in the .html file? Print

  • 3

อยากเขียนโค้ด php ใน ไฟล์นามสกุล html
How to perform PHP code in the .html file?

=======================
สำหรับ mode_php  .htaccess

<IfModule dir_module>
DirectoryIndex index.html index.htm index.shtml index.php index.php5 index.php4 index.php3 index.phtml index.cgi index.pl
Addhandler application/x-httpd-php .php .htm .html .wml
</IfModule>

หมายเหตุ : อาจใช้งานได้กับ บางโฮสติ้ง ที่รองรับ

=======================

สำหรับ FastCGI mode

php works in FastCGI mode .htaccess

<FilesMatch "\.(html|htm)$">
AddHandler fcgid-script .php .html
FCGIWrapper "/usr/local/safe-bin/fcgid53.sh" .htm
#FCGIWrapper "/usr/local/safe-bin/fcgid53.sh" .html

</FilesMatch>

It does not work. The code is not executed. Files in the folder /usr/local/safe-bin/fcgid53.sh there.
หรือ


<FilesMatch "\.(html|htm|php)$">
Addhandler application/x-httpd-php .php .htm .html .wml
AddHandler fcgid-script .php .htm .html
FCGIWrapper "/usr/local/safe-bin/fcgid53.sh"
#FCGIWrapper "/usr/local/safe-bin/fcgid56.sh"
</FilesMatch>

=======================

สำหรับ php-fpm
ติดต่อ ไลน์ ID @hostnakhonitech

สำหรับ LiteSpeed SAPI

ติดต่อ ไลน์ ID @hostnakhonitech


Was this answer helpful?

« Back