Webmaster Key - Discussion Forums


Welcome, Guest. Please login or register.
Did you miss your activation email?
February 08, 2012, 07:21:57 PM

Login with username, password and session length
Welceome to Forums!

Important information for guests and new members:

In order to understand the full benefits of becoming an active member of this forum, please review the following information on guest and new member restrictions. These forum changes have been prompted by an overwhelming and unreasonable amount of bot postings and incoherent guest spam messages. We wish to prevent these events from happening in the future and make our community a more comfortable place for all of our members.

For guests:

Guests are not allowed to open new topics, polls, or posts attachments.
If you wish to open up new discussions on this forum, we encourage you to register.

For new members:

New members with less than five posts are not allowed to modify additional profile information such as avatars, contact information, biographies, and signatures. However, new members are encouraged to post their own topics or reply to topics initiated by other members. Become active on the forums and 5 posts should be an easy task!

We are a diverse community with members from all over the world. We encourage new ideas and interesting conversation. Do not be afraid to post webmaster/computer-related questions or problems, as our active members are always willing to help when they are able. Interested? Join us.

+ Webmaster Key Forums
|-+ Webmaster Corner
| |-+ Site Design and Web Authoring
| | |-+ Coding Talk
| | | |-+ Setting up a PHP5 development environment
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Stumble Upon! Digg It! del.icio.us! Add to Technorati! ReddIt!  Send this topic Print
Author Topic: Setting up a PHP5 development environment  (Read 1603 times)
Andy
Administrator
Veteran
*****
Posts: 5 752



« on: February 18, 2009, 11:29:29 AM »

PHP5 now includes greatly enhanced support for OOP (using classes and objects rather than mainly procedural code). PHP4 supported objects but it was very limited IMO. I wanted to get up to speed with PHP5 so installed a new development environment on Windows XP. At the same time I installed an IDE for developing PHP code. I also think that if you want to learn about OOP programming, PHP may be one of the easiest ways to do it, mainly due to the quality of the online documentation and examples available at www.php.net (my favorite website LOL).

At first I tried to install Apache web server but couldn't get it to recognize paths to mysql dlls. This seems to be a common problem with all kinds of workarounds suggested online. Also I had problems getting xdbug.dll to work. Then I discovered xamp which makes the process of setting up a local WAMP server very easy. You can download it from: www.apachefriends.org This setup contains the latest PHP, MySQL and Apache server. Plus it has a great interface to check PHP settings etc.

It comes with xdebug which I wanted for use with the IDE (NetBeans). But, to enable it you need to edit the php.ini files (there are 2). Here is a tutorial on that: http://malibugarage.blogspot.com/2007/07/last-week-i-got-xamppeclipse-pdtxdebug.html In the latest version of xamp I found that all I had to do was comment zlib stuff and uncomment xdebug stuff (including the xdebug module entry) and restart the server.

NetBeans is a powerful IDE that includes version control, syntax highlighting and debugging. It also supports multiple platforms and technologies. You can download it from: http://www.netbeans.org/

All the above is free software too!

Time to get programming ...

Udate: I don't think the debugger feature works with windows XP. It connects but it does not stop at break points. I suspect it is to do with difficulty resolving paths to files which is the problem you get when trying to set up the apache webserver on windows.

Finally to get this working I installed Linux  Shocked (ubuntu) running inside VirtualBox on my XP machine. Then in Linux I installed: xampp, Java SDK, Java JRE, xdebug and NetBeans.

Helpful links in getting it working:

Virtual Box - to be able to run Linux in parallel with Windows on a windows machine and easily flip between OS's.

Change Screen Resolution For Ubuntu 8.04 Running Under VirtualBox I set mine to 1680x1050 with 24 bit color. Works fine.

The http document root in xampp on Linux is not accessible from Netbeans so I edited the httpd file in /opt/lampp/etc/ to have an alias for a  /home/user/www folder So the url: http://localhost/www/ now points to files in my user area in a www folder. So now this folder can be specified as the document root in NetBeans. I wanted to preserve access to the xampp local web page which has useful links to admin features such as phpmyadmin, that's why I didn't specify a new default document root.

The line of code is:
Alias /www /home/user/www

where user, is your user name.

See:
Mapping URLs to Filesystem Locations

In the NetBeans documentation they suggest setting up a virtual server which I didn't like the idea of. My way is much simpler I think.

Another tip: with ubuntu you can precede commands that require admin privileges with the word: sudo

To understand how to do basic things in Linux, you are best off searching online with a well crafted search phrase since there are plenty of solutions posted on blogs and forums. But, you can waste a lot of time finding up to date suggestions that actually solve your problem. I am a Linux newbie but with ubuntu much of the command line stuff can be avoided by using the GUI tools.

I must say that ubuntu was extremely easy to install on my system and installing all the extras I needed was easy too with some being automatically downloaded after keying in some commands, plus I didn't need to study how to use it apart from searching on how to install certain kinds of compressed files. Virtual Box seems great too, much better than having a dual boot system I think.

« Last Edit: February 21, 2009, 11:11:33 AM by Andy » Report to moderator   Logged

Pages: [1] Go Up Stumble Upon! Digg It! del.icio.us! Add to Technorati! ReddIt!  Send this topic Print 
+ Webmaster Key Forums
|-+ Webmaster Corner
| |-+ Site Design and Web Authoring
| | |-+ Coding Talk
| | | |-+ Setting up a PHP5 development environment

Jump to:  
« previous next »


Our Partners
RelmaxTOP Ranking System Web Hosting RelmaxTOP Ranking System
Staff Sites
12Noon[12Noon Gallery] Andy[Urgentclick]
Tamuril[Tamuril's Digital Art Exhibit] Sensovision
Powered by MySQL Powered by PHP We are hosted by Relmax Inc. |Our Privacy Policy | Sitemap
Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC
Forum design by Tamuril © 2005.
Valid XHTML 1.0! Valid CSS!