Installing Zend Server 6.1 using Nginx and PHP 5.4.

Zend recently updated Zend Server and added the ability to use Nginx as the web server. I thought I would give it a go. I have installed Zend Server 6.1 on a fresh new install of Cent OS 6.4 (I used the minimal install ISO weighing at around 300 meg).

The following are the steps required to install.

Firstly we need to create the Nginx repository file as we re going to use yum to install everything:

touch /etc/yum.repos.d/nginx.repo

Next we need to add the repo details to use. Firstly open the file in vi:

vi /etc/yum.repos.d/nginx.repo

Then add the repo details (press “i” before typing, 😡 to close and save the file)

[nginx]
 name=nginx repo
 baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
 gpgcheck=0
 enabled=1

We now need to do the same for Zend Server:

touch /etc/yum.repos.d/zend.repo

Open the file:

vi /etc/yum.repos.d/zend.repo

Enter the repo details (remembering to press “i” before typing, 😡 to close and save the file):

[Zend]
 name=zend-server
 baseurl=http://repos.zend.com/zend-server/6.1/rpm/$basearch
 enabled=1
 gpgcheck=1
 gpgkey=http://repos.zend.com/zend.key
[Zend_noarch]
 name=zend-server - noarch
 baseurl=http://repos.zend.com/zend-server/6.1/rpm/noarch
 enabled=1
 gpgcheck=1
 gpgkey=http://repos.zend.com/zend.key

Now we simply need to download everything. For this I am choosing to use PHP 5.4 (my choices are 5.4 and 5.3, replace 5.4 with 5.3 in the next command if you are chosing PHP 5.3):

yum install zend-server-nginx-php-5.4

You maybe prompted to allow a key to be used. This is ok we are using the official repos for the packages so select y if prompted.

After some time (depending on your connection speed) Zend Server 6.1, PHP 5.4 and Nginx will be installed and we can reach the GUI. You maybe wondering when we installed Nginx. When we asked yum to install Zend Server it saw that it was dependant upon Nginx being installed first so added this to the download list (and used the Nginx repo from above to install it).

Now I am only using this locally behind a router etc so decided that I would disable iptables. I strongly recommend you do not do this for public servers. To disable iptables simply run the following command:

/etc/init.d/iptables stop

We can now access both the Nginx web server and the Zend Studio control panel which is located at http://your-ip:80081

Now we shall finish the installation. Firstly accept the licence and click next. The choose the profile you are using. As this is a development machine for me I am going to choose the development option. Needless to say you should choose the option that is right for your situation. Again click on next.

On this next page it is going to ask you for a password 4 time. 2 for the admin and 2 for the developer. If you intend to use the free licence, the developer password really is not going to be of much use but I would set something you will know anyway. The developer user is disabled for the free licence. Click next after entering the password.

On the next page click next. Read the summary and click submit.

After a few moments you will enter the web interface for the Zend Server application. Be sure to browse about and become comfortable with it. Be warned tho the initial licence is a trial licence and after 7 days you will need to enter a new licence. As mentioned there is a free licence which will disable some functionality (but still useful). For a breakdown of what each licence includes be sure to check our the Zend Server editions page which has more info.

One last note. The first time entering the web interface you will not be prompted for a login. After this you will need to use a login. The login is:

Username: admin
Password: As entered

Enjoy and happy programming.

Updating Zend Server 6.01 (PHP 5.4.11) to 6.10 (PHP 5.4.16)

Not too long ago I installed Zend Server which is a great tool that can help you manage and debug your PHP applications. It can also help make sure that your development environment is the same as your live environment so that surprises are less common for you.

Recently Zend updated Zend Server to 6.10 however there are no good instructions on how to update the product. After a bit of browsing I could see some questions about how to do this but little in the way of answers (it did only update a few days ago).

Anyway when you install Zend Server on Linux it sets up a new yum repository to use to install and keep the package updated however when trying to update nothing actually updated.

Upon checking the repository file at “/etc/yum.repos.d/zend.repo” I found that this contained the following:

[Zend]
 name=Zend Server
 baseurl=http://repos.zend.com/zend-server/6.0/rpm/$basearch
 enabled=1
 gpgcheck=1
 gpgkey=http://repos.zend.com/zend.key
[Zend_noarch]
 name=Zend Server - noarch
 baseurl=http://repos.zend.com/zend-server/6.0/rpm/noarch
 enabled=1
 gpgcheck=1
 gpgkey=http://repos.zend.com/zend.key

As you can see the file specifically references the repository for 6.0. To try to fix this I changed the file to have:

[Zend]
 name=Zend Server
 baseurl=http://repos.zend.com/zend-server/6.1/rpm/$basearch
 enabled=1
 gpgcheck=1
 gpgkey=http://repos.zend.com/zend.key
[Zend_noarch]
 name=Zend Server - noarch
 baseurl=http://repos.zend.com/zend-server/6.1/rpm/noarch
 enabled=1
 gpgcheck=1
 gpgkey=http://repos.zend.com/zend.key

Once I had done this I then carried out the following 2 commands:

yum clean all
yum update

This now prompted me if I wanted to update many components. Low and behold Zend Server now reports:

PHP Version 5.4.16Zend Server Version: 6.1.0

Zend Framework: 1.12.3, 2.2.1
Zend Server Gateway: 0.9.0
Build: 71826

Fingers crossed. All appears fine.

One thing that is a bit disappointing however is that now we have no ETA on Zend Server with PHP 5.5 support. I was looking forward to utilising some of the PHP 5.5 features on the product I am making.

PHP 5.5 Release Imminent

*** New Since Writing This ***

PHP has now officially been released as can be seen on the PHP news page.

***

The release of PHP 5.5 is imminent now. The source code now appears to be getting merged on the official PHP github repository. The news file (which highlights a lot of the new features and fixes) can be found at https://github.com/php/php-src/blob/php-5.5.0/NEWS. I am particularly looking forward to using the new password functionality as well as being able to use the FINALLY keyword.

Along with the release of PHP 5.5 this will begin the end of life process for PHP 5.3. The issue is already being discussed on the PHP internals list.

http://news.php.net/php.internals/67734

As you can see the current plan is that once 5.3.27 is release in a few weeks the only updates to the 5.3 branch will be security only fixes (and there doesn’t appear to be any opposition to this). Johannes Schluter has posted a new blog post about what you can do from here if you are using PHP 5.3 and can be found here.

Now really is a good time to be looking at upgrading PHP. Preferably you should be looking at upgrading to 5.5.

ADDED

A good video to help explain the new release and update cycle for PHP can be found on youtube (this subject starts at 3:14):

My First Foray Into Conferences

For sometime I have been considering going to a PHP conference. The plan was to travel to the US to maybe go to PHPTek. The biggest thing that really stopped me doing so was the massive potential costs. As I live in the UK the flights bio would be extortionate not to mention the hotel bill.

While perusing the internet last december I came across the PHP UK Conference which is organised by the PHP London user group. On seeing this I realised I was going through an unusual stage of having some spare cash so decided to take the plunge and purchase tickets for the 2 day conference.

The conference has been running successfully now for the past 8 years and was this year held in the brewery in the heart of London. From what I understand this is the first time the conference has been held in this venue.

The Venue

The venue for the conference was the Brewery which ceased to be an acting brewery in the 70’s. More recently the Brewery has become a conference centre . The centre itself is fairly sprawled out with conference rooms spanning 3 floors (well 3 that I am aware of). The brewery was very inviting and fairly easy to navigate once you got to grips where the rooms were all situated.

The Talks

The talks were quite widespread in subject matter ranging from the talks you would expect such as scaling PHP and new features that are coming with PHP through to using such products as Vagrant. The speakers ranged quite wildly in their abilities. Some appeared to have no fear at all and did not get phased (Beth Tucker Long, how you coped with the changes in schedule with such short notices astounds me) and others appeared unprepared (although I suspect this was more nerves getting the better of them at times. For some this was their first jump into giving talks (to be fair I cannot really criticise, i got so damn nervous when asking a question in Beth’s talk so I have no idea what I would have been like standing there for 45 minutes doing it).

1 speaker even managed to find a link between toilets and design. Aral Balkan is an amazing speaker and was an ideal choice for keynote speaker. I really feel for those people who had a talk directly after as Aral was a hard man to follow. He may not have a huge knowledge of PHP but his talks a very thought-provoking and inspiring.

1 thing that I was annoyed by was that some speakers were rushed off of the stage due to their talk over running. Although I understand that there are schedules and allowing 1 talk to go over can throw this out some form of allowance should have been made (maybe something to look at in future conferences).

The People

London isn’t exactly known for its friendly atmosphere and people as anyone who has travelled by tube or walked around Piccadilly Circus will know and appreciate however the people at the conference were very friendly. I did not socialize a lot (I know I missed out on a bit of networking there) however I did find myself talking to some very interesting people.

The range of different people at the conference was quite amazing ranging from people who are very active in the core development of PHP through to project managers (some who were new to PHP), and general programmers. Sometimes as is the way you can learn just as much if not more from others people’s experiences and opinions, you can gain a lot through talking these through.

The App

Prior to attending the conference I created a simple iPhone app and submitted this into the app store. Now I am not going to into detail here on my first experience of releasing an app however what I will say is that although it was fairly easy to submit the time taken to be accepted was quite annoying (especially as on 1 occasion on submitting an update the sql file did not compile into the package for some reason so the app did not work properly yet did in the simulator). The app itself managed to get around 30 people downloading it prior to the conference. This is not a huge amount but not bad considering it was uploaded a week before the conference.

I had planned on releasing more updates and features prior to the conference however time constraints did not permit. I am planning now on recreating an app but in more of a kit form so that it can be tailored for other conferences. 1 of the problems I found for this release was also due to schedule changes I was required to update the database of talks which is hard-coded into a SQLite database included in the app. For the next release such tasks will be retrievable by JSON/XML and allow users to update this way instead of updating the app in the app store (note to self contact the PHP London guys and ask if interested in an official app).

Conclusion

If there are any suggestions that I can make is that it could be worth having variable length talks. Some talks really could have done with being longer. Although I can see this being very difficult to organise..

The work that must go into organising such an event must be immense and PHP London did a very admirable job and should be immensely proud of their efforts. I have never been to such conference before but going by my experience this weekend I am sure it will be the first of many. I thoroughly enjoyed the conference.

Oh and I am really looking to seeing the recordings of the talks that I could not make due to clashes. Keep an eye on YouTube. PHP London advise these should be posted at some point in March.

Logical Operators in PHP

Just a very quick post. Most of us use the operators && (AND) and || (OR) but 1 that I always forget is XOR. I have knocked up a quick image showing the results when comparing the logical operators in PHP.

Operators
Operators

As you can see XOR returns true if only 1 of A or B is true. This is not as commonly used as && or || but still useful.

Domains For Sale

I am currently looking to raise some cash and have just posted some quality domain names. I am open to offers. Feel free to comment or to post on Namepros or DNForum.

The domains for sale are:

Domain: DiverseBlog.com
Creation: 14 Dec 2006
Expiry: 14 dec 2011
Registrar: GoDaddy

Name and potential uses speak for themselves. A great little domain for a blog.

—————————————————————————-

Domain: DomainingArticles.com
Creation: 11 July 2009
Expiry: 11 July 2012
Registrar: GoDaddy

Another name thatspeaks for itself. I had partially created a script for this but thus far had not completed this.

—————————————————————————-

Domain: LinuxDaemon.com
Creation: 10 May 2008
Expiry: 10 May 2012
Registrar: eNom

I thought of creating a site with information on the common linux daemons. There are some sites that do this already but not have such an apt domain. You could also of course have tutorials detailing how to create a linux daemon.

—————————————————————————-

Domain: ObscureRecords.com
Creation: 25 Jan 2008
Expiry: 25 Jan 2013
Registrar: eNom

This domain has many possibilities. Obscure or rare LP’s, or maybe showing some of the oddest world records that have been achieved.

—————————————————————————-

Domain: PHPSecured.com
Creation: 18 June 2008
Expiry: 18 June 2012
Registrar: eNom

A perfect domain for articles or tutorials for showing how to secure PHP or possibly to code with security in mind (something that is often forgotten).