Welcome! Log In Create A New Profile

Advanced

How do I implement to Apache "AddType application/x-httpd-php" ?

Posted by 90island 
How do I implement to Apache "AddType application/x-httpd-php" ?
April 24, 2013 05:17AM
Hello.
I would like to work ".html" includes php code.

------------------------------
When I use Apache I wrote:
AddType "application/x-httpd-php" .html

------------------------------
I tried to write in php-fpm and Nginx:

<php-fpm>
listen = /var/run/php-fpm.sock
security.limit_extensions = .php .html .htm

<nginx (backend.conf)>
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
include /etc/nginx/expires;
log_not_found off;
}

location ~ \.(php|html|htm|jpg)$ {

expires off;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_param REMOTE_ADDR $http_x_real_ip;
fastcgi_pass_header "X-Accel-Redirect";
fastcgi_pass_header "X-Accel-Buffering";
fastcgi_pass_header "X-Accel-Charset";
fastcgi_pass_header "X-Accel-Expires";
fastcgi_pass_header "X-Accel-Limit-Rate";
}

------------------------------
This config is something wrong.
When access this web site, my brouser shows html page. php code in html iw working fine.
but, images, javascripts, css files cannot access.

LOG file :
2013/04/24 17:58:12 [crit] 4970#0: *41 open() "/data/mypage/images/top4.jpg" failed (1: Operation not permitted), client: unix:, server: mypage.com, request: "GET /images/top4.jpg HTTP/1.0", host: "mypage.com", referrer: "http://mypage.com/"


please help me.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 253
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready