Start your PHP website


    This guide is going to help you start developing your PHP websites at SourceLair and make the most out of SourceLair's capabilities.

    This guide assumes that you already have

    Public URL

    PHP projects at SourceLair are equipped with a dedicated development server running Apache2, which is publicly accessible using its Public URL. You can use it to develop and test your website or showcase your work to other people.


    By default your development server looks for a PHP file called index.php in your project's root folder (mnt/project/) and displays that as the homepage of your website.

    How to use

    There are 2 ways to access the Public URL of your project:

    • Click on the eye icon at the left sidebar of the IDE
    • Open Command Palette (Ctrl/Cmd + Shift + P) and write in free text "public url" and press "Enter"

    Installing dependencies

    Composer is pre-installed into your server and so you can use its commands from your fully featured terminal.

    Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you. You can read more here.


    In SourceLair there are 2 ways to connect a database server (e.g. MySQL) to your project:

    • During project creation, choose the "Custom" tab and then the database you want to work with.
    • During development, open your project settings (the gear icon next to your project's name), choose the database that you want and click on "Connect a database" button.

    If you need more information, you can read our help pages about databases.


    It is common for PHP developers to work with MySQL GUI tools like phpMyAdmin.

    In order to install phpMyAdmin in SourceLair you have to follow the same process that you would follow if you developed locally. The only difference is the content of the file. Here is a brief guide for installing and configuring your phpMyAdmin to your MySQL in SourceLair.

    Install and configure phpMyAdmin

    1. Connect a MySQL to your project as described in the previous step.
    2. Install phpMyAdmin with composer, following the instructions below:

      • Create a file called composer.jsonand add the version of phpMyAdmin that you want. You can find the available versions and their format at the official phpMyAdmin website. For example, for the version 4.62, our composer.json should be:
        "packages": {
           "phpmyadmin/phpmyadmin": {
               "4.7.0": {
                   "name": "phpmyadmin/phpmyadmin",
                   "version": "4.7.0",
                   "dist": {
                       "url": "",
                       "type": "zip"
      • Run the following installation command
        composer create-project phpmyadmin/phpmyadmin --repository-url= --no-dev
    3. Create a file inside your /phpmyadmin folder with the following content:
     * Generated configuration file
     * Generated by: phpMyAdmin 4.5.4 setup script
     * Date: Fri, 29 Jan 2016 12:34:04 +0000
    /* Servers configuration */
    $i = 0;
    /* Server: sourcelair [1] */
    $cfg['Servers'][$i]['verbose'] = 'sourcelair';
    $cfg['Servers'][$i]['host'] = 'mysql';
    $cfg['Servers'][$i]['port'] = '';
    $cfg['Servers'][$i]['socket'] = '';
    $cfg['Servers'][$i]['connect_type'] = 'tcp';
    $cfg['Servers'][$i]['auth_type'] = 'cookie';
    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = '';
    /* End of servers configuration */
    $cfg['blowfish_secret'] = '56ab5b9bda6305.64858666';
    $cfg['DefaultLang'] = 'en';
    $cfg['ServerDefault'] = 1;
    $cfg['UploadDir'] = '';
    $cfg['SaveDir'] = '';

    That's it. Your phpMyAdmin is installed and configured to your MySQL. All you have to do now is go to <Public URL>/phpmyadmin/ (e.g. and login with the same credentials you have for your MySQL database. You can find details about your default MySQL username and password here.

    Tips to code faster

    SourceLair provides you with some great features in order to help you develop faster your website being focused on the creative part of programming.


    When you write your PHP, HTML or CSS files, SourceLair's editor automatically place your cursor at the correct indentation level so that you don't have to worry about it. Although, when you break down your format you can select the number of lines you want to "auto-format" and press Shift + Tab.

    Command Palette

    Command Palette is a free text search tool which helps you use most of SourceLair's features really fast. You can open it by pressing Ctrl/Cmd + Shift + P.


    Quickopen is a fast and time saving way to navigate through your filesystem in order to find and open any file you want using your keyboard.

    There are 2 ways to open the Quickopen prompt:

    • using its shortcut Ctrl/Cmd + Shift + O
    • finding the Quickopen: Open a file command from Command Palette (Ctrl/Cmd + Shift + P)

    Find in files

    Find in files is a simple and easy way to search for something in your entire project at once, with quick file navigation from the results. There are 2 ways to trigger this feature:

    • finding the Project:Find in files command from Command Palette
    • using its shortcut Ctrl/Cmd + Shift + F


    There are many ways to deploy your PHP website, choose the one that fits your needs: