Consider the scenario of a PHP script which can be run for a period of time, stopped, and continue its task later on. A common necessity for such a script may be to detect when the script is terminated, and … Continue reading
Tag Archives: php
PHP-FPM on Amazon’s Linux
Update (Oct 1, 2011): The release notes for the newest version of Amazon’s Linux (2011.09) state that “PHP scripts have the option of using PHP-FPM.” PHP-FPM is now included in the amzn-main repository, and can be installed via yum install … Continue reading
Prime Factoring with PHP
A surprisingly large number of math based computer problems appear to require factorization, finding prime number, or prime factoring. Presented below is a reasonably fast algorithm for prime factoring a number – it is limited to the integer size on … Continue reading
Hardening PHP with Suhosin
Suhosin is a package designed to harden PHP, in the sense that it addresses potential vulnerabilities that might be introduced through user scripts. It comes as both a patch which can be applied directly to the PHP source code and … Continue reading
Fractions
For many people the mere mention of fractions elicits a wince, and while these lovely math constructs played a notable role in our early years of math, they are reasonably simple entities. While most humans revisit fractions over many years … Continue reading
Setting the timezone on PHP
Versions of PHP after 5.10 include the date.timezone directive in php.ini. Many applications which reference time need this directive to be set. A list of accepted values can be found at: http://www.php.net/manual/en/timezones.php The timezone is set as a quoted string, … Continue reading
Installing mcrypt (PHP) on AWS Linux AMI
Update: with the update of PHP to v5.3.3, the amzn repository now includes php-mcrypt, rendering the steps below unnecessary. At the moment, the amzn repository has v5.3.2 of PHP (while the latest version is v5.3.3) – it also does not … Continue reading
Installing APC on AWS Linux AMI
Update: Current versions of Amazon’s Linux AMI include the package php-pecl-apc (v3.1.9 – the same as the latest from PECL) in the repository. Using a package manager is usually preferable to using PECL- it will help you keep up to … Continue reading