PHP 5.6 – The migration review from a developer POV

OK, by listening to a friend on one of the PHP groups i am a member of, i decided to upgrade my PHP version from 5.4 to 5.6.

Yes, it is an easy task as it sounds, but it has some configuration issues we should go over…

There are many small features that always irritate me, like constants and SSL (You can see the small changes on laracasts short 10 minute video – Recommended),and now i can say the changes are not that far from 5.5 on the infrastructure aspects, but in the parsing and security rules there is a big and blessed change, that i find more sure to continue develop with PHP.

But in this review i review the migration and not the functionality (Yet), and before i give you the bottom line, i want to show you how to migrate your PHP version as quick as taking a shot of vodka…

I assume you are working with xampp. and if not, this tutorial is just for you (If you are using xampp, good job, the update will take seconds).

The XAMPP installation

Go into apache friends and download xampp version with PHP 5.6.3 built in installation for windows (Still working with Microsoft, sue me…) and run the installation.

The XAMPP installation includes the following resources (Copied from the download site of XAMPP) :

  1. Apache 2.4.10
  2. MySQL 5.6.21
  3. PHP 5.6.3
  4. phpMyAdmin 4.2.11
  5. OpenSSL 1.0.1
  6. XAMPP Control Panel 3.2.1
  7. Webalizer 2.23-04
  8. Mercury Mail Transport System 4.63
  9. FileZilla FTP Server 0.9.41
  10. Tomcat 7.0.56 (with mod_proxy_ajp as connector)
  11. Strawberry Perl 7.0.56 Portable

I changed my root directory again to my dropbox PHP projects folder (Step #1 will elaborate), and the configuration part ended successfully as i ran the test phpinfo() function and it looked fine.

 Step #1 – The installation

First we need to download the OS XAMPP version we want. You can find all the downloads on apache friends. The installation is complete and you get after launching it a full working environment for PHP development with the latest release (for the time these lines are written) ready to go.

WordPress administrators watch out :

wpdb::prepare() and wpdb::escape() is deprecated due to security reasons. Read all about it on wordpress blog.

 Just before you go, you will probably want to configure your document root, which is, if you are new to this term/configuration, is where your web server will run sources (scripts) from,or as apache explains it “Directory that forms the main document tree visible from the web“.

So,launch the xampp admin panel (In the xampp installation directory you will recognize it as “xampp-control”) and you will get the administration panel for all xampp resources.

xampp-control

As you can see, you can start and stop all features from a single place… although this is not PHP exact topic, but most of PHP developers do not need to integrate and upgrade resources such as PHP,MySql and more, this is a complete and reliable package for server purposes.

Another great thing to it, for Windows users, is the face that you can activate these features service, but remember this : Each server in XAMPP you can install also as Windows service. You can also install it from the XAMPP Control Panel. In this case it is necessary to run the scripts or the Control Panel with Administrator privileges.

Click on the “Config” button in the Apache row and you will see all the ini files you can configure by hand. Just do not start the server before submitting these changes, because they will not take effect after you stop and start again :).

 

I will not talk about all the configuration that we can do here, it is a topic of its own, but as you can see, one can control everything from the xampp control panel (Sounds like a sales presentation for xampp, isn’t it? Lucky for me, its free LOL).

apache_config

  1. Click the “Apache (httpd.conf)” (usually the first from top, and the configuration file for the server will open.
  2. Search for the String “DocumentRoot” and you will arrive into the localhost’s document root path. Change it as you please (I am pointing to my dropbox’s PHP folder, so i can get to my resources from everywhere without configure my brains out.
  3. Don’t forget to save and close the file. Start the server and you are ready to develop fast and complete.

 

 

 

 

 

Running PHP apps

 

While server running, you can go to your favorite browser and go to “http://localhost” and see your projects tree as a web page, this is like saying “Mission accomplished”.

Each PHP file you will save under this folder, you can run as server resource.

 

Developing smart

This is it people, you made it through the process of migrating to PHP 5.6. I will not finish without asking from each and every one of you :

Share your knowledge, help others become good developers and develop smart, control Object oriented structures and methods, share scripts and tricks, sell only complete solutions, and contact each other.

That was a quick how to upgrade/install PHP 5.6 into your machine, but this is not the end of the process i want you to go through. I want us all to learn to become good and reliable online, so we can leave a good impression on our potential clients.

And for the freelancers among you – Best of luck, you are exactly where you should be!

 

Oh, oh, please help me and share this post if you liked it… There are buttons there at the end for a reason dudes and dudets…

Share this article

2 thoughts on “PHP 5.6 – The migration review from a developer POV

  1. Pingback: PHP password encryption | PHP Raxan and Ajax

  2. Pingback: Chapter #1 – Setting the server and database | PHP Raxan and Ajax

Leave a Reply

Your email address will not be published. Required fields are marked *

*