treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] Setting up a local testing server (WAMP) with Sublime Text

  • I am finally giving DW the boot and trying Sublime Text as recommended by loads of people here. However, I don't know the steps to connect to WAMP and need some help establishing a local server with Sublime Text. Any help appreciated!
  • Hey,
    I personally recommend XAMPP for it's simplicity
    http://www.apachefriends.org/en/xampp.html
    Once you get your WAMP set up you can just open the folder of your document root with ST2
  • What Karl said - this is how I have it setup. I run XAMPP on my networked Windows 7 machine and then code via Sublime Text 2 on my mac, simply opening the htdocs folder over the network, this allows "live" testing and saving across.

    Sure it's not as simple as FTP via Dreamweaver but, I'd recommend using an FTP program like Filezilla (free) any day of the week.
  • Hey Karl - thanks for this. I will give it a whirl. I want to see if I have more luck than with DW.
  • I am little confused - why run WAMP and XAMPP?

    Also both are trying to run from the same socket so Xammp isn't working.
  • @karlpcrowley or @andy_unleash - ok, got xampp working (sorry about above - i switched off wamp) and placed the relevant files into the htdocs folder in xampp. Tried to open from ST2 but no dice. Am i missing a step?
  • Also getting this error message when opening http://localhost/lesson-25/in my browser:

    Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES)' in C:\xampp\htdocs\lesson-25\functions.php:5 Stack trace: #0 C:\xampp\htdocs\lesson-25\functions.php(5): PDO->__construct('mysql:host=loca...', 'root', 'root') #1 C:\xampp\htdocs\lesson-25\index.php(4): connect() #2 {main} thrown in C:\xampp\htdocs\lesson-25\functions.php on line 5
  • Just for anyone who may experience the same problem, the issue for me was that I failed to set a password in the code (below) from the functions.php file that corresponds to the database that I set up in xampp:


    function connect() {
    global $pdo;
    $pdo = new PDO("mysql:host=localhost;dbname=sakila", "root", "root");


    I hate myself sometimes!
  • @andy_unleash There is a plugin available for Sublime Text 2 that allows you to upload (using Transmit) by simply pressing CMD+U: https://github.com/jeffturcotte/sublime_transmit_docksend

    I highly recommend it; you just set it up using Transmit's DockSend.
  • Nice one Josh
    I <3 Sublime Text 2 :D<br />
    I've been meaning to test this out but haven't had the time
    https://github.com/kemayo/sublime-text-2-git
  • I have seen that too Karl, but I (like any typical designer) am scared of the command line, so I use the Github app for Mac.
  • Josh - many thanks for this, I wasn't aware of the plugin and it's definitely going to make my life easier!