Install pecl_http for PHP

You will probably want to ensure that curl supports https before getting underway:

curl -V

Check that the output contains https:

>: curl -V
curl 7.19.2 (i386-apple-darwin9.5.0) libcurl/7.19.2 OpenSSL/0.9.8i zlib/1.2.3
Protocols: tftp ftp telnet dict http file https ftps 
Features: Largefile NTLM SSL libz

If it doesn’t:

sudo port deactivate curl
sudo port install curl +ssl

Once you have curl with https support:

sudo pecl install pecl_http

If you followed my previous howto, you’ll want to move the module to the location specified in your php.ini file:

sudo cp /opt/local/lib/php/extensions/no-debug-non-zts-20060613/http.so /opt/local/lib/php/extensions

Restart lighttpd and then you’ll be good to go.

2008-11-24 [, , , , , , , ] No Comments

Install PHP5, lighttpd and Imagick on Mac OS X Leopard

It’s a little tricky getting a nice clean install of PHP5 for OS X 10.5. The packages that I always used to depend on over at Entropy don’t seem to work anymore. At least not for Leopard. A great shame.

I’m now switching to lighttpd for my development server, so have come up with the following recipe to install PHP5 and the great Imagick extension for image manipulation.

(more…)

2008-11-22 [, , , , ] 11 Comments

lighttpd and PHP on CentOS 5

Here’s a quick run down on getting lighttpd and php running on CentOS 5.

yum install lighttpd lighttpd-fastcgi php
mkdir /var/run/lighttpd
touch /var/run/lighttpd/php-fastcgi.socket
chown -R lighttpd:lighttpd /var/run/lighttpd/
vim /etc/php.ini

Add in php.ini the following; cgi.fix_pathinfo = 1. Save and close the file.

Now open up /etc/lighttpd/lighttpd.conf. Uncomment the following line "mod_fastcgi", from the server.modules option. Then ensure that the following is uncommented:

fastcgi.server  = ( ".php" =>
    ( "localhost" =>
        (
            "socket" => "/var/run/lighttpd/php-fastcgi.socket",
            "bin-path" => "/usr/bin/php-cgi"
        )
    )
)

Save the file. Now create a test file, /srv/www/lighttpd/index.php and just include <?php phpinfo(); ?>. Now open your favourite browser and visit http://localhost/index.php. You should be greeted with a friendly PHP page, and you’re set to go.

2008-06-22 [, , , ] 6 Comments