Archive for category Servers

Ubuntu 10.04 – Looks like it will ship with PHP 5.3

I took a look on Launchpad today to see if there was any indication as to which version of PHP Ubuntu had decided to ship with the next release. As it’s an LTS release there is always the possibility that they may go for the slightly more stable options than the slightly more experimental options as they will have to support this edition for the next 3 years.

It appears from a package search that 2 days ago PHP 5.3.1 packages were added to Lucid. It’s quite a big step, and will be interesting if they also include a 5.2.x release along side it as so many applications are not ready for 5.3 yet.

More information can be found on Launchpad:


  • Share/Bookmark

Zend Server 5.0 Upgrade Fix

As mentioned in my previous post about Zend Server 5.0 upgrade, the GUI images are missing following the upgrade.

It turns out that for some reason Apt doesn’t properly upgrade the Zend Server package itself, to fix this I ran the repository installer script again on all effected machines.

$ sudo ./install_zs.sh 5.3 ce

Running this script will preform the following:
* Configure your package manager to use Zend Server repository
* Install Zend Server on your system using your package manager

Hit ENTER to install Zend Server, or Ctrl+C to abort now.

–2010-03-01 22:53:18– http://repos.zend.com/deb/zend.key
Resolving repos.zend.com… 93.188.128.18
Connecting to repos.zend.com|93.188.128.18|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 1673 (1.6K) [text/plain]
Saving to: `STDOUT’

100%[==============================================================================================================================>] 1,673 –.-K/s in 0s

2010-03-01 22:53:19 (57.4 MB/s) – `-’ saved [1673/1673]

OK
Writing extended state information… Done
Hit http://gb.archive.ubuntu.com karmic Release.gpg
Get:1 http://gb.archive.ubuntu.com karmic/main Translation-en_GB [63.7kB]
Hit http://security.ubuntu.com karmic-security Release.gpg
Ign http://security.ubuntu.com karmic-security/main Translation-en_GB
Get:2 http://gb.archive.ubuntu.com karmic/restricted Translation-en_GB [3,402B]
Get:3 http://gb.archive.ubuntu.com karmic/universe Translation-en_GB [33.2kB]
Get:4 http://gb.archive.ubuntu.com karmic/multiverse Translation-en_GB [43.8kB]
Get:5 http://gb.archive.ubuntu.com karmic-updates Release.gpg [189B]
Ign http://gb.archive.ubuntu.com karmic-updates/main Translation-en_GB
Ign http://gb.archive.ubuntu.com karmic-updates/restricted Translation-en_GB
Ign http://gb.archive.ubuntu.com karmic-updates/universe Translation-en_GB
Ign http://gb.archive.ubuntu.com karmic-updates/multiverse Translation-en_GB
Ign http://security.ubuntu.com karmic-security/restricted Translation-en_GB
Ign http://security.ubuntu.com karmic-security/universe Translation-en_GB
Ign http://security.ubuntu.com karmic-security/multiverse Translation-en_GB
Hit http://security.ubuntu.com karmic-security Release
Hit http://gb.archive.ubuntu.com karmic Release
Get:6 http://gb.archive.ubuntu.com karmic-updates Release [44.1kB]
Hit http://repos.zend.com server Release.gpg
Hit http://security.ubuntu.com karmic-security/main Packages
Hit http://security.ubuntu.com karmic-security/restricted Packages
Hit http://security.ubuntu.com karmic-security/main Sources
Hit http://security.ubuntu.com karmic-security/restricted Sources
Hit http://security.ubuntu.com karmic-security/universe Packages
Hit http://security.ubuntu.com karmic-security/universe Sources
Hit http://security.ubuntu.com karmic-security/multiverse Packages
Hit http://security.ubuntu.com karmic-security/multiverse Sources
Hit http://gb.archive.ubuntu.com karmic/main Packages
Hit http://gb.archive.ubuntu.com karmic/restricted Packages
Hit http://gb.archive.ubuntu.com karmic/main Sources
Hit http://gb.archive.ubuntu.com karmic/restricted Sources
Hit http://gb.archive.ubuntu.com karmic/universe Packages
Hit http://gb.archive.ubuntu.com karmic/universe Sources
Hit http://gb.archive.ubuntu.com karmic/multiverse Packages
Hit http://gb.archive.ubuntu.com karmic/multiverse Sources
Get:7 http://gb.archive.ubuntu.com karmic-updates/main Packages [182kB]
Get:8 http://gb.archive.ubuntu.com karmic-updates/restricted Packages [14B]
Get:9 http://gb.archive.ubuntu.com karmic-updates/main Sources [54.4kB]
Get:10 http://gb.archive.ubuntu.com karmic-updates/restricted Sources [14B]
Get:11 http://gb.archive.ubuntu.com karmic-updates/universe Packages [108kB]
Get:12 http://gb.archive.ubuntu.com karmic-updates/universe Sources [26.3kB]
Get:13 http://gb.archive.ubuntu.com karmic-updates/multiverse Packages [6,844B]
Get:14 http://gb.archive.ubuntu.com karmic-updates/multiverse Sources [3,820B]
Ign http://repos.zend.com server/non-free Translation-en_GB
Hit http://repos.zend.com server-testing Release.gpg
Ign http://repos.zend.com server-testing/non-free Translation-en_GB
Hit http://repos.zend.com server Release
Hit http://repos.zend.com server-testing Release
Ign http://repos.zend.com server/non-free Packages
Ign http://repos.zend.com server-testing/non-free Packages
Ign http://repos.zend.com server/non-free Packages
Ign http://repos.zend.com server-testing/non-free Packages
Hit http://repos.zend.com server/non-free Packages
Hit http://repos.zend.com server-testing/non-free Packages
Fetched 569kB in 3s (188kB/s)
Reading package lists… Done

Reading package lists… Done
Building dependency tree
Reading state information… Done
Reading extended state information
Initialising package states… Done
The following NEW packages will be installed:
help-zend-server-ce{a}
The following packages will be REMOVED:
libcurl3{u} php-5.3-code-tracing-zend-server{u} php-5.3-pecl-http-zend-server{u}
The following packages will be upgraded:
zend-server-ce-php-5.3
1 packages upgraded, 1 newly installed, 3 to remove and 1 not upgraded.
Need to get 3,668kB of archives. After unpacking 13.3MB will be used.
Do you want to continue? [Y/n/?] y
Writing extended state information… Done
Get:1 http://repos.zend.com server/non-free help-zend-server-ce 5.0.0+b6 [3,666kB]
Get:2 http://repos.zend.com server/non-free zend-server-ce-php-5.3 5.0.0+b2 [1,388B]
Fetched 3,668kB in 0s (7,644kB/s)
(Reading database … 78500 files and directories currently installed.)
Removing php-5.3-pecl-http-zend-server …
Removing libcurl3 …
Removing php-5.3-code-tracing-zend-server …
Processing triggers for libc-bin …
ldconfig deferred processing now taking place
Selecting previously deselected package help-zend-server-ce.
(Reading database … 78474 files and directories currently installed.)
Unpacking help-zend-server-ce (from …/help-zend-server-ce_5.0.0+b6_all.deb) …
Preparing to replace zend-server-ce-php-5.3 4.0.5+b5 (using …/zend-server-ce-php-5.3_5.0.0+b2_all.deb) …
Stopping Zend Server 5.0 ..

Stopping Zend Server GUI [Lighttpd] [OK]

Zend Server stopped.
Unpacking replacement zend-server-ce-php-5.3 …
* Starting web server apache2 [ OK ]
Setting up help-zend-server-ce (5.0.0+b6) …
Setting up zend-server-ce-php-5.3 (5.0.0+b2) …
* Stopping web server apache2 … waiting [ OK ]
Starting Zend Server 5.0 ..

spawn-fcgi: child spawned successfully: PID: 4704
Starting Zend Server GUI [Lighttpd] [OK]
[ 01.03.2010 22:54:20 SYSTEM] watchdog for lighttpd is running.
[ 01.03.2010 22:54:20 SYSTEM] lighttpd is running.

Zend Server started…

Reading package lists… Done
Building dependency tree
Reading state information… Done
Reading extended state information
Initialising package states… Done
Writing extended state information… Done

Current status: 1 update [-1].
Zend Server was successfully installed.

After this everything worked as it should!

  • Share/Bookmark

New ffmpeg builds projects page

I’ve added a new projects page for my ffmpeg builds for PHP 5.3.
The new page also includes a version compiled against PHP 5.3.1 from today’s new Zend Server release.

The new page can be found here.

  • Share/Bookmark

Zend Server 5 / PHP 5.3.1 released

Today Zend announced the release of Zend Server 5.0, which also includes PHP 5.3.1.

I have performed an apt-get update/upgrade on my servers which worked without issue, however the GUI seams to be a bit buggy following the upgrade. Firstly it looks like some of the styles and images are wrong/missing and secondly the restart button doesn’t seam to work.

For full downloads visit the Zend website:


  • Share/Bookmark

PHP 5.3 on Ubuntu – Configuration

I’ve been testing PHP 5.3 on various Ubuntu machines for the last few months (since around the time of my first post). I’m now running it on a production server for 1 site.

I noticed I have been getting a lot of hits on my previous post, mainly from others looking for ways to install PHP 5.3 on Ubuntu so I thought it was about time for a follow up.

I’m using PHP 5.3.0 as this is the latest release for Zend Server, the only 5.3.1 release I’m aware of is the DotDeb packages. I try to stay clear of DotDeb, mainly because the packages are built for Debian which often causes issues and conflicts. (Ubuntu is based on Debian unstable so can potentially have a completely different version of every package than the Debian stable branch, as well as changes/tweaks/updates from the Ubuntu team.)

Here are the tweaks I have made to enable PHP to run smoothly, it’s generally quicker to use the Zend web GUI, but these changes can also be done by editing php.ini or adding/removing symbolic links to extensions:

Config changes:

  • Set the default timezone. This seams to be a requirement for PHP 5.3 to have the local timezone set, otherwise we are spammed with about 20 deprecated message when PHP starts. There are a number of ways to do this, the easiest of which is to set the date.timezone config parameter.
  • Set the full path to sendmail. The PHP mail() command will fail unless this is done, this is due to a bug in either PHP or Zend Server (which of them, I’m not sure). Set the sendmail_path config parameter to do this.
  • [Optional] By default the maximum file size you can upload is around 8Mb, if you are likely be using larger files than this, video uploads for example, this change becomes essential. There are 2 options for this setting, both post_max_size and upload_max_filesize should be set.
  • [Optional] By default session timeouts are very short (only about 20 mins), I find it’s usualy a good idea to make it longer.

Extension changes:

  • By default Zend Server comes with tonnes of database extensions, MySQL, PostGreSQL, MSSQL, ODBC, OCI8, SQLite plus PDO versions of most of the above. There is no point having extensions in there we don’t need, pick the extension(s) you need and disable the rest.
  • Disable pcntl on web server environments, as it is apparently not supposed to be used in this way.

This is really all is need to get things up and running, shouldn’t take more than a minute to do.

  • Share/Bookmark

Which RAID is best?

There are many sites with various RAID comparisons on and many more making various claims as to which RAID type is the best for various purposes/fastest/etc.

The 2.5Tb storage partition on my Xen box decided to pack up recently (or at least Xen decided it no longer wanted to read the partition) so after backing up the data decided to run some tests.

Drives: 4x Western Digital RE 1Tb

RAID 5:

This was the original configuration of the array, despite having fast drives in my desktop and 1Gbit network the read speeds were slower than expected (around 35Mb/sec).

The hdparm results were inconsistent:

Timing cached reads: 10118 MB in 2.00 seconds = 5064.59 MB/sec
Timing buffered disk reads: 224 MB in 3.02 seconds = 74.24 MB/sec

Timing cached reads: 10020 MB in 2.00 seconds = 5016.71 MB/sec
Timing buffered disk reads: 148 MB in 3.03 seconds = 48.83 MB/sec

Timing cached reads: 10126 MB in 2.00 seconds = 5068.86 MB/sec
Timing buffered disk reads: 200 MB in 3.03 seconds = 65.94 MB/sec

Timing cached reads: 10086 MB in 2.00 seconds = 5049.90 MB/sec
Timing buffered disk reads: 234 MB in 3.02 seconds = 77.55 MB/sec

Timing cached reads: 10042 MB in 2.00 seconds = 5027.45 MB/sec
Timing buffered disk reads: 210 MB in 3.01 seconds = 69.80 MB/sec

Average over the 5 tests: 67.27 Mb/sec

RAID 10:

As an alternative I switched the array to RAID 10, the downside of this configuration is that there is 1Tb less space than RAID 5.

Timing cached reads: 10170 MB in 2.00 seconds = 5091.34 MB/sec
Timing buffered disk reads: 320 MB in 3.01 seconds = 106.46 MB/sec

Timing cached reads: 10094 MB in 2.00 seconds = 5052.71 MB/sec
Timing buffered disk reads: 316 MB in 3.02 seconds = 104.59 MB/sec

Timing cached reads: 10072 MB in 2.00 seconds = 5041.96 MB/sec
Timing buffered disk reads: 314 MB in 3.01 seconds = 104.29 MB/sec

RAID 10 results are much more consistent.
Average over the 3 tests: 105.11 Mb/sec

RAID 6:

Another configuration offering 2 disk redundancy.

Timing cached reads: 10172 MB in 2.00 seconds = 5091.87 MB/sec
Timing buffered disk reads: 202 MB in 3.01 seconds = 67.06 MB/sec

Timing cached reads: 10052 MB in 2.00 seconds = 5031.76 MB/sec
Timing buffered disk reads: 202 MB in 3.01 seconds = 67.18 MB/sec

Timing cached reads: 10102 MB in 2.00 seconds = 5057.17 MB/sec
Timing buffered disk reads: 206 MB in 3.00 seconds = 68.59 MB/sec

RAID 6 results are also fairly consistent.
Average over the 3 tests: 67.61 Mb/sec

It seams that with this configuration that RAID 5/6 perform at roughly the same speed, however RAID 10 seams to win out on the speed test with over 50% improvement over RAID 5/6.

  • Share/Bookmark

Compile ffmpeg-php for PHP 5.3 (Yes – it DOES work!)

Search Google for a version of ffmpeg-php that works with PHP 5.3 and you will find nothing useful. In fact there are many sites where people claim that it does not work with PHP 5.3. Well, they’re wrong! It’s not the easiest thing to get to work but it DOES work with PHP 5.3. (Scroll down for download link to my version of ffmpeg.so)

I am using Zend Server version of PHP 5.3 on Ubuntu 9.10 RC, this is what I did:

1. Install PHP sources (not 100% sure if this is actually required): sudo apt-get install php-5.3-source-zend-server.
2. Install build tools: sudo apt-get install build-essential
3. Install autoconf: sudo apt-get install autoconf
4. Install ffmpeg: sudo apt-get install ffmpeg
5. Install dev/header packages required to build: sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libgd2-xpm-dev
6. Download latest ffmpeg-php source:



7. tar xjf ffmpeg-php-0.6.0.tbz2
8. cd ffmpeg-php-0.6.0
9. (Zend Server – Optional) PATH=$PATH:/usr/local/zend/bin
10. phpize (produces LOADS of warnings, ignore, this is fine)
11. ./configure –enable-skip-gd-check
12. make
13. Copy ./modules/ffmpeg.so into PHP extensions directory or location of your choice
14. Add to php.ini or custom ini file: extension=ffmpeg.so
15. Restart the web server.

ffmpeg-php is now installed!

Download compiled ffmpeg.so file here: ffmpeg-php-0.6.0-php5.3.tar.gz

This is from my phpinfo:

PHP 5.3 with ffmpeg-php

  • Share/Bookmark

Easy PHP 5.3 installation (Ubuntu)

I’ve been searching around for deb packages for PHP 5.3 for Ubuntu for a while, but not found a solution close to the ease of the original (Debian style) packages with a separate deb package for each extension. I’ve used Dotdeb packages in the past, however there are often small issues with these due to missing libraries (usually due to them being compiled on Debian which has older versions of some libraries than Ubuntu) and there are also some posts on their site in the PHP 5.3 section indicating that there are issues installing these packages on Ubuntu.

The EASY solution: Zend Server Community Edition

Installation:

1. Download the ‘Universal Repository Script’ (ZendServer-4.0.5-RepositoryInstaller-linux.tar.gz) from the Zend website.
2. tar xjf ZendServer-4.0.5-RepositoryInstaller-linux.tar.gz
3. cd ZendServer-RepositoryInstaller-linux
4. sudo ./install_zs.sh 5.3 ce

This will add the Zend repositories to apt and start the installation.

Fix dependency with Ubuntu 9.10 RC (and possibly earlier versions) as Ubuntu 9.10 uses a later version of libkrb53 than Zend packages:

1. Download the Lenny version from Debian for your architecture:



2. Install via dpkg -i

Rerun the Zend installer above after doing this.

Install extra PHP extensions:

sudo apt-get install php-5.3-extra-extensions-zend-server

Access Zend Server to manage PHP:

HTTP: http://localhost:10081/ZendServer
HTTPS: https://localhost:10082/ZendServer

You will probably notice that tonnes of extensions are installed by default, to enable/disable them go to:
Server Setup -> Extensions
Click restart PHP in the bottom right to restart the web server.

To change PHP ini settings go to:
Server Setup -> Directives
Click restart PHP in the bottom right to restart the web server.

As Zend are using Apt PHP packages will be kept up to date as long as you update your system regularly (something which is distinctly lacking in Ubuntu/Debian).

Zend Server also includes script caching by default which should give speed improvements to executing PHP code.

More info on installation can be found here (note this has instructions for PHP 5.2):


  • Share/Bookmark