#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    5
    Rep Power
    0

    Getting xampp to work


    This has newbie question has probably been answered already in this forum. Sorry for not finding it.

    I just installed xampp on Windows 7 and everything looks like it's good to go.

    How do I configure it to run my php pages that I'm testing? I'd kinda hoped it would just DO it, but it's apparently not that simple.

    Thanks.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Location
    the Netherlands
    Posts
    40
    Rep Power
    1
    go to the htdocs folder in the XAMPP installation directory. within that folder make another folder; I called mine sandbox. then put your php files in there. whenever you want to test your php script, just use your browser and go to localhost/sandbox, and you'll get a list of the files in there. note: if you name a file index.php, you won't get the list, it'll only load that file, that's why within the sandbox folder I've made a bunch of other folders.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2009
    Posts
    667
    Rep Power
    6
    First of all, is PHP even correctly installed/running. A simple phpinfo() will tell you this, or even a simple echo script to say Hi. By default, for MOST installs, htdocs is the default directory hosted. Once you find this folder, simply make sure your PHP is running fine, and you're set to go.

    Iunno if you will be sharing any of this server with anyone, but just something out there for thought... Even my development servers have multiple users. htdocs has its own hard drive. Within the htdocs folder is just other folders defined by username. This makes it easy to set up FTP access, and to define something like http://users.whatever.com/(username) until something more direct is set up.
    Last edited by Triple_Nothing; July 27th, 2013 at 01:24 PM.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    5
    Rep Power
    0
    Thechooch:
    Okay, that works. Thanks.

    BUT, does this mean I need to do all my development in that directory--i.e. move the entire website into htdocs?

    That would be awkward, since I'm developing on top of an existing website, and have some links into the older one.But it would seem necessary in order to keep the links within my new site intact.

    So do I just relocate the entire (local) site--old files and new ones--into a new folder in htdocs?

    TripleNothing: Yes, it runs the scripts already in the installation, now that I know where to direct the browser. Your reply sounds like the answer to my question above is, Yes, you put everything (the whole website) into htdocs.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2009
    Posts
    667
    Rep Power
    6
    You can have your directory anywhere on the drive. htdocs is just the default root directory with the install. If you want default to be a folder on the desktop, then alter your httpd.conf as desired. If multiple folder are to be hosted outside htdocs, then look into vhost.
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    5
    Rep Power
    0
    Originally Posted by Triple_Nothing
    If you want default to be a folder on the desktop, then alter your httpd.conf as desired.
    That seems to work (after a few frustrating typos!).

    Originally Posted by Triple_Nothing
    If multiple folder are to be hosted outside htdocs, then look into vhost.
    I'll keep this in mind to try later. I'm not sure what vhost is, but can probably find it.

    Many thanks to both of you.
  12. #7
  13. Mad Scientist
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2007
    Location
    North Yorkshire, UK
    Posts
    3,660
    Rep Power
    4123
    For everything I develop locally I work inside c:\xampp\htdocs

    To help manage URL paths, consider this:

    In your hosts file (C:\Windows\System32\drivers\etc\hosts) add a line like

    Code:
    127.0.0.1	local.www.website.co.uk

    Then, in one of your apache conf files (probably C:\xampp\apache\conf\extra\httpd-vhosts.conf)

    put something like
    Code:
    #modify paths as necessary
    <VirtualHost 127.0.0.1:80>
    	ServerName local.www.website.co.uk
    	DocumentRoot C:/xampp/htdocs/www.website.co.uk/htdocs
    	<Directory "C:/xampp/htdocs/www.website.co.uk/htdocs">
    		Options Indexes FollowSymLinks
    		AllowOverride All
    		Order allow,deny
    		Allow from all
    	</Directory>
    </VirtualHost>
    then flush your dns cache and restart apache (either look it up or restart your computer)

    You'll now be able to go to the url http://local.www.website.co.uk and have it behave as a proper website
    I said I didn't like ORM!!! <?php $this->model->update($this->request->resources[0])->set($this->request->getData())->getData('count'); ?>

    PDO vs mysql_* functions: Find a Migration Guide Here

    [ Xeneco - T'interweb Development ] - [ Are you a Help Vampire? ] - [ Read The manual! ] - [ W3 methods - GET, POST, etc ] - [ Web Design Hell ]
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    5
    Rep Power
    0
    Northie, the best I can do with this info at this point is file it away for the future. You're way over my head.

    While I'm working on a single site and the php is on a relatively small scale, I think I'm okay with just editing the one default. I'll have to grow a bit before I understand what you're describing. Hopefully that time will come.

IMN logo majestic logo threadwatch logo seochat tools logo