Setting up a PHP Development Environment – v2

Leave a Reply

Comment as a guest.

  1. Hmm … trying to install guest additions with no success… first time it fails silently, second time I get the dreaded {VERR_PDM_MEDIA_LOCKED} error…

  2. Hi, going through the steps from start and finding a few hitches, hope the feedback will help make it even better 🙂 … so far, got a “default website already enabled” in step 28 (do I have to add those lines at the end of the file, or substitute them to the content of …./sites/available/default ?)

    , and a “no phpize command” at step 30. so at the moment I will not be installing xdebug since I am unable to perform all steps.

    also, just checking – is it correct to name the shared folder “somefoldername” at step 24 and then using it later like “sf_somefoldername” ?

    will run through it all again later today …

    1. “default website already enabled” in step 28

      Yeah, default site is enabled by default, I’ve removed the command from the tut above.

      a “no phpize command” at step 30

      Need to install PHP5 dev package. Run this:

      1. sudo apt-get -y install php5-dev

      I’ve added this also to the tut above. :tup:

      is it correct to name the shared folder “somefoldername” at step 24 and then using it later like “sf_somefoldername” ?

      The image that shows addition of shared folder (in the STEP 24), it shows folder path and folder name. Now your folder on the host OS can be “abc” but if you set “pqr” as folder name in that dialog box, your folder will be available as “sf_pqr”. So its the name you give in that dialog box is what matters. For simplicity I’d suggest you keep same name, so if your folder on host OS is “somefoldername” then keep the same name in that dialog box & it’ll be available as “sf_somefoldername” in ubuntu vm. :tup:

  3. Hey, great tutorial. What I’m wondering is what about testing? When I create my helloworld.php file and save it to the ubuntu_server folder I created I can access it in my virtual machine so I know it’s saving there but when I run it from my local machine I get:

    Unable to load page

    Problem occurred while loading the URL http://localhost/test/newfile.php

    Cannot connect to destination (localhost)

    So do I just need to install Apache, PHP and MySQL on my local machine. I’m running Xubuntu on my laptop if that matters.

    Thanks and I appreciate the time you took to create this. Great job 😎

    Leo

    1. Have you pointed your host OS “localhost” to your VM? You’ll need to add a record in your host OS hosts file to do so, “localhost” points to same OS, so if you access “localhost” from your host OS it’ll not point to VM on its own. Refer to Step 25 above to see how to add it to your hosts file.

      Secondly, you’ll need to create a vhost in Apache in your VM to point “localhost” to the directory you want (“ubuntu_server” seems to be it from your comment). Refer to Step 28 above to see how to go about it.

    2. Hey Amit,

      Thanks for the reply, I appreciate it. My bad though, What I did was in step 28 I added the code to sudo nano /etc/apache2/sites-available/default instead of replacing the code with yours. Works great now.

      Thanks for this, I bookmarked for future reference 😀

      Leo

  4. Hey, so I was just wondering. Are you going to update this for Ubuntu 14.04. I’m following along for 14.04 right now to create a node environment.

    I was just thinking maybe some of your readers may like that. Especially since this page ranks well for setting up a dev environment. Just a thought.

    Thanks again for this. It’s my template lol

    Leo

    1. I don’t think an update is needed because other than grabbing the 14.04 iso (instead of 12.04) for installing Ubuntu in VM, the steps would remain same. Or have you run into issues which need different approach than the way its done in here?

    2. Ya, on step 28 there is no longer just a default file, there is now 2 files; 000-default and default-ssl.

      Also in the newer versions of Apache “RewriteLog” is unsupported.

      I think everything else is about the same.

  5. I am using 14.04.1 and getting “You don’t have permission to access / on this server.” issue on http://sandbox.dev/ from host OS. I checked all permissions and I have no idea what I’ve done wrong 🙁

    1. I fixed it adding another with “all granted” record for /media/sf_/ to apache2.conf.

Sliding Sidebar