Experiences with PHP and Setting Up

In the last couple of weeks I have started to research PHP in more detail in order to find out more about how I can make use of it in my future projects. However, so far, despite reading claims that PHP is as easy to pick up as HTML once you get past the basics, I have seen no evidence of simplicity at all.

Merely installing the programs required to use PHP is a gargantuan task in itself, and by no means user friendly. Although PHP is the most popular programming language because of its simplicity, I find it hard to understand how so many people could work out how to get it installed on their systems in the first place.

Code is required from the get go. To use PHP and test it on your home system, you are required to run a server in the background. Many people prefer to use Apache, which is what I have installed, but other servers can be used such as Microsoft Internet Information Server. Installing Apache was the first hurdle to getting PHP working, and it wasnt too difficult to locate and install. Get Apache from http://httpd.apache.org, by downloading the stable windows version. If you cannot find it, do what I did and type “apache-1.3.31-win32-x86-no_src.msi” into google. The first link that comes up should download the correct version.

The next part of the PHP environment to obtain is a database server such as MySQL . MySQL is free to download so it is a popular choice amongst web developers. I have had problems with this from the moment I downloaded it, and at the time of writing this blog I still dont have MySQL working alongside my server and PHP. MySQL can be downloaded from http://www.mysql.com, and the latest version can be found in the community download area. Again, MySQL is free to download and use, which makes it popular.

The final item needed is PHP itself. I downloaded PHP 5 from the PHP website. Actually finding the correct version is hard enough as the website is difficult to navigate and quite confusing. After eventually downloading a no-install version, I consulted my PHP in easy steps book to work out how to install it manually. To do this a file called PHP.ini needs to be copied into your windows folder, and then edited to contain several lines of code which make it compatible with Apache and MySQL. Tests can then be carried out by typing simple html code including some lines of PHP code, which determine if the environment is correctly set up.

Suffice to say, mine wasnt, and as I mentioned before, I am still having troubles getting MySQL to connect to my Apache server. Anyone who has any interest in learning PHP, I strongly suggest getting a book to start you off, which has clear instructions on how to set up the working environment before launching you into tutorials. The book which I have does this quite well, but it doesnt tell you how to correct errors if something doesnt work.

If you would like to check it out, its called PHP 5 in easy steps, by Mike McGrath.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: