-
Getting the current interpreter in PHP
Recently a friend of mine asked if there is a way to dynamically find out the path of the PHP executable. The working scenario was: running some scripts (from the command line) which would spawn other scripts and rather than hardcoding the path to the PHP interpreter he wanted to use the same interpreter when…
-
An argument (against) PHP
-
HTTP Redirection with PHP – a complete solution
-
Reading the fineprint in the documentation
Following the DokuWiki development mailing list, I saw the following changelog: Sun Apr 6 19:47:18 CEST 2008 Andreas Gohr * work around strftime character limit on parsing namespace templates FS#1366 I checked on the PHP documentation page (by the way, a quick tip: you can access the documentation for a given PHP function by appending…
-
Updating PHP in XAMPP for Windows
-
Serving up authenticated static files
Two components which are usually found in web applications are authentication and static files. In this post I will try to show how these two interact. The post will refer to PHP and Apache specifically, since these are the platforms I’m familiar with, however the ideas are generally applicable. The advantages of static files are:…
-
Compressed HTTP
The HTTP standard allows for the delivered content to be compressed (to be more precise it allows for it to be encoded in different ways, one of the encoding being compression). Under Apache there are two simple ways to do this: Using the mod_deflate Apache module If you have mod_php activated, setting the zlib.output_compression variable…
-
Input validation
The month of PHP bugs is over, but you should still watch the PHP-Security blog, since there are good things coming from there, like this article: Holes in most preg_match() filters. Go read it if you are using regular expressions for input validation. Two tips to avoid these pitfalls: Cast your input to the datatype…
-
Month of PHP bugs roundup
-
Update on the Month of PHP Bugs
The month is nearing to an end (but fear not, next month we will have a month of MySpace bugs it seems), and here are the latest developments: Two bugs using which you can bypass the open_basedir restriction. They are in the user-contributed PECL modules, so there is a chance that they will be fixed…