Book Image

concrete5 Beginner's Guide

Book Image

concrete5 Beginner's Guide

Overview of this book

Table of Contents (19 chapters)
concrete5
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – installing XAMPP


concrete5 is a PHP application which uses PHP as its programming language in combination with a MySQL database. There are lots of possibilities to meet the requirements of concrete5. The preferred web server is Apache, IIS should work as well but isn't supported by the core team, even if it isn't as well tested as Apache.

If you already have a server or a local Apache, PHP, and MySQL setup, you can skip this step and continue with downloading concrete5. Otherwise, you are going to need to install XAMPP on your local computer by following these simple steps:

  1. Go to http://www.apachefriends.org/ and click on XAMPP for Windows. Scroll down and download the latest version of XAMPP Lite. If you're not very familiar with these tools, you should download the EXE and not the ZIP. Double-click the EXE as soon as it has been downloaded. You should see the following window:

  2. Click Install to start the installation process; it will take a while as it extracts quite a lot of files. You can install XAMPP in your program directory C:\Program Files but it won't work on Vista unless you modify some privileges. If you don't feel comfortable changing your security settings, just use C:\ instead.

    Note

    If you want to know more about the security changes needed on Vista to install XAMPP in your program directory, go to this page and follow the instructions: http://www.apachefriends.org/en/faq-xampp-windows.html#vista

  3. After the installation has completed you'll see an old fashioned console window asking a few questions. They look like this; you can confirm all default values:

  4. At the end you'll see a menu where you can execute different actions. You'll later have to start the XAMPP Control Panel but let's leave this screen untouched for now; we have to make one modification first.

    Before you start XAMPP, you should change one MySQL setting. MySQL table names are not case sensitive on Windows. This will cause some problems if you want to move your site to a Linux server where MySQL is by default set up with case sensitive table names. It's therefore recommended to change this, if you work with concrete5:

  5. Go to the directory where you've installed XAMPP, open mysql and then bin. It should look like the following:

  6. The my.ini file contains several settings related to MySQL. Open the file and locate the section mysqld and insert the following line:

    lower_case_table_names = 0

    The first lines should then look like the following:

    # Example MySQL config file for medium systems.
    #
    # This is for a system with little memory (32M - 64M) 
    # where MySQL plays an important part, or systems 
    # up to 128M where MySQL is used together with
    # other programs (such as a web server)
    #
    # You can copy this file to
    # /etc/my.cnf to set global options,
    # mysql-data-dir/my.cnf to set server-specific options 
    # (in this installation this directory is @localstatedir@)
    # or
    # ~/.my.cnf to set user-specific options.
    #
    # In this file, you can use all long options that a 
    # program supports.
    # If you want to know which options a program supports, 
    # run the program with the "--help" option.
    
    # The following options will be passed to all MySQL clients
    [client]
    #user       = your_username
    #password   = your_password
    host        = .
    port        = 3306
    socket      = "MySQL"
    
    # Here follows entries for some specific programs
    
    # The MySQL server
    [mysqld]
    lower_case_table_names  = 0
    basedir                 = "C:/xampplite/mysql/"
    datadir                 = "C:/xampplite/mysql/data/"
    port        = 3306
    socket      = "MySQL"
    skip-locking
    key_buffer              = 16M
    max_allowed_packet      = 1M
    table_cache             = 64
    sort_buffer_size        = 512K
    net_buffer_length       = 8K
    read_buffer_size        = 256K
    read_rnd_buffer_size    = 512K
    myisam_sort_buffer_size = 8M

    Tip

    Downloading the example code for this book

    You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

  7. Now that MySQL is properly configured, go back to the XAMPP console menu and enter 1 to open the control panel where you can start and stop all components. You should see the following window:

  8. Start both Apache and MySQL, and your web server will be up and running in no time, ready for concrete5!

  9. If everything worked you should be able to open your browser and enter http://localhost/. On this screen you can select your preferred language and you'll see a nice status page about XAMPP.

Note

It might just happen that Apache doesn't start because port 80 is already used by an application like Skype. You can click on Port-Check to see if there are any ports being used before you start the XAMPP services. If there are, either disable the other services, or reconfigure, or stop them.

What just happened?

The XAMPP setup package installed a working web server, including PHP with the most commonly used modules and a MySQL database. This is what a lot of web applications need, an environment which works for a lot of web applications and CMS's as well.

You've also had a quick look at one MySQL configuration file to avoid problems when moving your data to a Linux server. If you want to know more about this setting, the MySQL documentation is going to answer almost any question about table names: http://dev.mysql.com/doc/refman/5.1/en/identifier-case-sensitivity.html.

Note

Please don't forget, XAMPP is by default a user-friendly and simple system but insecure to simplify the development process as much as possible. It is nice to work with and great for your first experience with your own web server, but not recommended for a production environment. Later in this book, we'll move your site to a LAMP server (Linux, Apache, MySQL, and PHP) which is more widely used by webhosting companies with a more secure configuration.

Pop quiz – requirements for concrete5

Like any other software, concrete5 needs certain things to run. Try to answer which of the following items are true:

  1. Which of the following server-side programming language(s) has been used to build concrete5?

    1. PHP

    2. Microsoft ASP

    3. Java

    4. All of the above

  2. Which of the following database(s) can you use with concrete5?

    1. PostgreSQL

    2. MySQL

    3. Oracle

    4. All of the above

  3. Which of the following operating system(s) can you use to run concrete5?

    1. Microsoft Windows

    2. Mac OS X

    3. Linux

    4. All of the above

  4. Name the webserver(s) you can use to run concrete5.

    1. Microsoft IIS

    2. Nginx

    3. Apache

    4. lighttpd