Development Environment
Results 1 to 13 of 13

Thread: Development Environment

  1. #1
    Junior Member
    Join Date
    Apr 2012
    Posts
    27

    Development Environment

    Hi,

    I am currently trying to learn PHP to develop a web application.
    I am using a wamp server (easyphp) and netbeans.
    Is this already a good environment to develop a php application?
    Thanks in advance

  2. #2
    Senior Member
    Join Date
    Aug 2008
    Location
    London, UK
    Posts
    753
    A Wamp stack isn't the best in my opinion, as hosting tends to be on a Lamp stack, and some things in PHP run differently on Windows than on Linux.

    That said, I've found Netbeans is quite a good IDE, and helps a lot with OO code.
    Ashley Sheridan
    www.ashleysheridan.co.uk

  3. #3
    Pna lbh ernq guvf¿
    Join Date
    Jul 2004
    Location
    Kansas City area
    Posts
    19,432
    The opinion of both myself and the PHP developers say that those *AMP(P) pre-packaged solutions should not be recommended. Instead, you should manually recreate your target production environment piece-by-piece (e.g. get PHP from php.net, get MySQL from mysql.com, get Apache from httpd.apache.org ... etc.) so that you can match versions, configurations, etc. as closely as possible.

  4. #4
    Senior Member Derokorian's Avatar
    Join Date
    Apr 2011
    Location
    Denver
    Posts
    1,787
    Also - to add to brad's post. You should look at using virtualbox this will allow you to run a different operating system than your primary OS. This will allow you to fully recreate a production server environment from OS to PHP version and settings.
    Sadly, nobody codes for anyone on this forum. People taste your dishes and tell you what is missing, but they don't cook for you. ~anoopmail
    I'd rather be a comma, then a full stop.
    User Authentication in PHP with MySQLi - Don't forget to mark threads resolved - MySQL(i) warning

  5. #5
    Pna lbh ernq guvf¿
    Join Date
    Jul 2004
    Location
    Kansas City area
    Posts
    19,432
    Quote Originally Posted by Derokorian View Post
    This will allow you to fully recreate a production server environment from OS to PHP version and settings.
    Well... not fully (there are still some limitations and/or differences).

    And besides, I'd hazard a guess to say that an overwhelming majority of PHP code created during web development (e.g. PHP isn't being used as a scripting language locally) is OS agnostic. I personally have never gone so far as to virtualize the target platform/OS during any web development.

  6. #6
    Senior Member Derokorian's Avatar
    Join Date
    Apr 2011
    Location
    Denver
    Posts
    1,787
    Ah I've gotten into the habit of recreating the OS environment simply because I had a project that involved quite a few system calls. Being that I'm a linux newb I thought it was best to develop on the same platform it would run, because I thought things would break. I run windows, and I've never had a windows server running apache for a production environment.
    Sadly, nobody codes for anyone on this forum. People taste your dishes and tell you what is missing, but they don't cook for you. ~anoopmail
    I'd rather be a comma, then a full stop.
    User Authentication in PHP with MySQLi - Don't forget to mark threads resolved - MySQL(i) warning

  7. #7
    Junior Member
    Join Date
    Apr 2012
    Posts
    27
    Thanks for your responses.

    some things in PHP run differently on Windows than on Linux
    How different is it?

    I have look into virtualbox.
    I have an Ubuntu 11.10 running on it.
    My friend also have an old computer running Ubuntu 11.04 which I can access using VNC.
    Although I haven't install any php and mysql on that computer

    However, if I put all my files, let's say into the Ubuntu 11.04. How can I generate an IP address to access my application? or is it only available in the localhost of the Ubuntu 11.04 itself?
    As i use some ip number in the VNC.

  8. #8
    Senior Member
    Join Date
    Aug 2008
    Location
    London, UK
    Posts
    753
    If you want to access the remote box with some kind of name rather than an IP then you need to do a couple of things. First, configure a virtual host (usually somewhere like /etc/httpd/conf.d/) for your website. You'll need to put in the information like where the files for the site exists (usually /var/www) and what domain it should look for and match to that site (e.g. yoursite.local)

    Then add an entry to your local hosts file (either c:\Windows\System32\drivers\etc\hosts or /etc/hosts) to point to the IP address of that server with the domain. It doesn't have to be a valid domain, just something that won't be easily confused with a real one seems best to me.

    If you don't fancy doing those steps, you can always just put in the IP address of the server in the browser, and if it's running a web server it will usually respond unless there are things like a Firewall getting in the way, etc.
    Ashley Sheridan
    www.ashleysheridan.co.uk

  9. #9
    Senior Member
    Join Date
    Aug 2008
    Location
    London, UK
    Posts
    753
    Oh, and as to how different, there are a few things:

    Any of the COM calls are Windows-only, as are a couple of functions here and there. These tend to be fringe functions though, so it's unlikely you'll come across them.

    Paths are the main thing that are different, and it's important to remember that Linux is case-sensitive, which is usually the most frequent cause for things like missing images or include files in your code.

    There are some things that are easier to do in Linux (like make zip files) which are more difficult on Windows because you have to install extra bits and make sure things are added to the system path. Linux tends to include these things by default.
    Ashley Sheridan
    www.ashleysheridan.co.uk

  10. #10
    Un Re Member cretaceous's Avatar
    Join Date
    Sep 2004
    Location
    London UK
    Posts
    941
    without contradicting the above advice, 99.9% of the time a wamp stack gets the job done

    ultimateley it depends what you want to do and where you want to get to

  11. #11
    Senior Member Derokorian's Avatar
    Join Date
    Apr 2011
    Location
    Denver
    Posts
    1,787
    Quote Originally Posted by cretaceous View Post
    without contradicting the above advice, 99.9% of the time a wamp stack gets the job done

    ultimateley it depends what you want to do and where you want to get to
    I agree completely, until that project with all the system calls (basically I built a web interface for off-site employees to use the proprietary software they owned) I did all my development on a WAMP stack. Granted there were a couple things to fix when it was finished and uploaded. But it also helped me learn to do things that would keep things from breaking upon upload. For a beginner, WAMP is great - if you're looking to do some advanced application you should install everything from the people that make it, not a bundle.
    Sadly, nobody codes for anyone on this forum. People taste your dishes and tell you what is missing, but they don't cook for you. ~anoopmail
    I'd rather be a comma, then a full stop.
    User Authentication in PHP with MySQLi - Don't forget to mark threads resolved - MySQL(i) warning

  12. #12
    Pedantic Curmudgeon Weedpacket's Avatar
    Join Date
    Aug 2002
    Location
    General Systems Vehicle "Thrilled To Be Here"
    Posts
    21,904
    Quote Originally Posted by Ashley Sheridan
    Paths are the main thing that are different, and it's important to remember that Linux is case-sensitive, which is usually the most frequent cause for things like missing images or include files in your code.
    One of the silly side-effects of this is in MySQL, where table names are case-insensitive or not depending on whether the host operating system treats file names case-insensitively or not.

    Quote Originally Posted by Derokorian
    For a beginner, WAMP is great - if you're looking to do some advanced application you should install everything from the people that make it, not a bundle.
    Where the distinction between "beginner" and "advanced" is modulated by the choice of bundle.

    One thing about installing PHP from php.net is that it is much easier on Windows (I'm counting Unix distribution packages as "bundles"): the hairiest bit is the fact if you're going to use Apache as the web server then (at present) you'd need a third-party build of that.

    But to install PHP on Windows:
    1. download the .zip from PHP for Windows.
    2. Unzip it somewhere convenient (for development on my machine, c:\php is good enough).
    After that it's a matter of fine-tuning php.ini and, if you want to use it for shell scripting on your machine, adding the location of php.exe to your PATH.

    Speaking of php.ini (create it by copying php.ini-development), it's often forgotten as "The Other Documentation", and is worth a read-through (something I suspect is generally skipped by bundled installers that would tune it for you).
    Last edited by Weedpacket; 04-18-2012 at 12:24 AM.
    THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER
    FAQs! FAQs! FAQs! Most forums have them!
    Search - Debugging 101 - Collected Solutions - General Guidelines - Getting help at all

  13. #13
    Somewhere on Mars chrisguk's Avatar
    Join Date
    Jan 2010
    Location
    Someone tell me?
    Posts
    208
    Just thought I would add my thoughts to this as well.

    I first started out using wamp a few years ago then suddenly realised that it doesnt work as expected. For example, when I finished a project and pushed it up to my virtual host, most of the things looked wrong or just didnt function correctly.

    It was at that point I made the switch to Ubuntu, you can install Apache2, php5, phpmyadmin(if you use it) and MySQL server/client. Essentially you can mirror the environment that most hosting companies use for their servers these days.

    I have been using Ubuntu now as my primary OS for two years and will never look back. Its flexible and you can pretty much do anything you want providing you have some Linux background, which I do of course.

    Because I wanted to use applications like Adobe photoshop to design my graphics and web layout templates, I went on to install Virtualbox, once you have installed the extra packages with virtualbox it works very well and I now use this to check sites in different browsers too.

    So in essence, MS Windows for me is history and I find it very unfriendly for a PHP development environment.
    Try not to become a man of success but a man of value

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •