Posts tagged with php

Unfortunately at work I’m stuck hosting PHP on various versions of Windows with IIS. For the most part things do just run (though I yearn for a nice Nginx + PHP-FPM setup that has decent URL rewriting), but figuring out what security settings to change so that PHP can write to a particular file or directory has always been a problem.

Continue reading →

I ran into what is apparently a pretty common issue with users running PHP as some sort of CGI with the Nginx webserver. If you’re trying to detect whether a user is using SSL you normally check to see if $_SERVER['HTTPS'] == 'on'. Well apparently this is more of an Apache-only convention than I thought… It won’t work under Nginx, your PHP script will never see an HTTPS server value and will always think the connection is unencrypted (in my case with the SSL Admin plugin for Wordpress, resulting in an infinite loop back to the SSL version of the page).

Continue reading →