Mark Foster’s Blog

Misadventures in Technology

Entries for the ‘PHP’ Category

How to make your PHP application check for its dependencies

The very informative phpinfo() function The phpinfo() function displays just about everything you want to know about your PHP installation. It includes info on all your PECL and PEAR modules so it is a quick way to check what’s installed. It will also tell you useful web server information including any query strings you pass. [...]

PHP HttpRequest class options and notes

In a recent post I talked about the PECL_HTTP extension for PHP. In this post I will cover a few of the options you can set for the HttpRequest object and related functions. The PECL_HTTP extension allows you to set a number of options when you make a request. Usually you put the options in [...]

How to: PECL HTTP request exception and error handling

In a previous post, we created a simple PHP page that told us if http://www.example.com is up or down by using the PECL HTTP extension to make an HTTP request to the site and look for the string “example” in the response. Here is the code for our test page, httptest.php: <?php $http_req = new [...]