View Single Post
Old 13th February 2012, 01:39
MainStreetJames MainStreetJames is offline
Junior Member
Join Date: Feb 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default ISPConfig & nginx - PHP Inside HTML Files Not Executing

Today's my first day with ISPConfig. I'm running ISPConfig & nginx 1.0.12 on CentOS 6.2.

I am able to display HTML pages, and PHP pages, but any PHP inside of an HTML page does not execute. I realize that mixing PHP inside the HTML isn't optimal use of nginx, but I need the code to work until I get a chance to separate everything.

I've tried adding the following (copied from the '\.php$' directive) to the vhost file for the site, but when I do I get a 403 error when trying to display HTML files (with or without PHP inside):

        location ~ \.html$ {
            try_files $uri =404;
    	    include /etc/nginx/fastcgi_params;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param PATH_INFO $fastcgi_script_name;
            fastcgi_intercept_errors on;
I've also tried adding the following to the site's php-fpm.d conf file, but it doesn't seem to make a difference:
security.limit_extensions = .php .html

I've checked the error logs in /var/log/nginx, /var/log/php-fpm & the site's log did, but there are no errors related to this issue.

I've tried changing the user from nginx to apache in the site's 'Web' tab in ISPConfig, but I still get the 403 error when the '~ \.html$' directive is in the vghost file. When I remove that directive the HTML files display properly, but the PHP inside is not executed.

Any help would be greatly appreciated.

Reply With Quote
Sponsored Links