Loading...
 
Free solution using XAMPP to create the server and Aptana for debugging/committing Type of page »  Developers documentation

XAMPP-Aptana

This page gives some tips on using XAMPP and Aptana Studio together to create a development environment on your machine to run, fix and commit changes to Tiki. See the Commit Code page for step-by-step instructions on how to commit code changes to the Tiki project.

The good thing about these programs is that they are multi-platform (they work on LINUX, Mac, Solaris and Windows machines) and, being packages, they minimize the number of programs that need to be installed. And one more thing: they're both open source and free!

Install XAMPP xampp logo

XAMPP combines all the programs you need to make your machine a server that can run a Tiki site locally just like an internet site: PHP, MySQL, Apache, phpMyAdmin, etc. Installation is simple - below are the steps by platform (so far, just Windows).

For Windows Machines

  1. Go to XAMPP for Windows and download the self-extracting version

  2. Double click to install.
    1. Leave destination folder as C:\
    2. Do not create an xampp folder, it will be created for you.

    Here's a screenshot:

    Xampp install window

  3. Answer questions in setup pop-up that appears

  4. Start the control panel, which is at C:\xampp\xampp-control.exe
    1. Make sure previous Windows services are deleted
    2. Turn on Apache and MySQL
    3. Set up as Windows services if you want the xampp server to be running when you boot up

      This screenshot illustrates the above steps:

       Plugin Image
      File not found.


There's a YouTube tutorial on this here

For Linux Machines

  1. Go to XAMPP for Linux and download the latest version.

  2. Through Terminal (Applications > Accessories > Terminal), navigate to the directory where the download was placed (usually the Downloads folder).

  3. Give yourself "root" privileges (XAMPP must be installed by root) by typing in the following in the Terminal:
    Copy to clipboard
    sudo -s

  4. Type in the command to extract the compressed file to the opt folder (substitute the actual name of the dowloaded file for FILENAME):
    Copy to clipboard
    tar xvfz [FILENAME] -C /opt

  5. Start XAMPP by using this command:
    Copy to clipboard
    /opt/lampp/lampp start

  6. If you have permission problems after installing, try the following commands to grant all permissions (777) to all folders under the htdocs folder, and more restricted permissions (644) to all files under htdocs:
    Copy to clipboard
    find /opt/lampp/htdocs/ -type d -exec chmod 777 {} \; find /opt/lampp/htdocs/ -type f -exec chmod 644 {} \;

    Linking to another folder and placing files here can also help avoid permission problems:
    Copy to clipboard
    sudo ln -s /home/[yourusername]/folder /opt/lampp/htdocs/$USER


The XAMPP for Linux site above also has good instructions. There's a YouTube tutorial on this here.

For Macs

The installation process is very simple and the instructions at XAMPP for Mac explain it well.

Install Aptana Studio Image

Aptana is quite powerful so there's more of a learning curve to getting used to it than a simple code editor, but it definitely pays off in the end. Here are some of its features:

  • Code editing:
    • Editors for different languages
    • Syntax error highlighting as you type
    • Syntax help and link to documentation
    • Syntax validation throughout entire project
    • Highlight a function call and press F3 to go to the function code
  • SVN
    • Full features including browsing the repository, comparing versions, viewing history, etc.
  • SSH/Shell access (uses PuTTy)
  • FTP
  • Debugger
  • Database utility
  • File manager

Installing the main program

For Windows and Mac, the installation process is straightforward, just download from www.aptana.com and follow installer instrucions.

For Linux, the main thing to note is you'll need to make sure that Java Runtime is installed first by going to System > Administraton > Synaptic Package Manager and installing the following (where X stands for the version): sun-javaX-jre and sun-javaX-plugin (other related apps will automatically be installed as well). There's a good YouTube tutorial on installing Aptana on Linux here.

Set Workspace

To work together with XAMPP, you should set your Workspace to be where your Xampp document root is (instead of using the default location) by doing the following:

  • Go to File > Switch Workspace > Other... and enter the path to the htdocs folder or browse to it. Below are the typical paths:
    • Windows: C:\xampp\htdocs
    • Linux: /opt/lampp/htdocs
    • Mac: /Applications/XAMPP/xamppfiles/htdocs


For Linux and Mac, you'll probably need to adjust the permissions for the htdocs folder and the items in that folder in order for Aptana to be able to work with it. Grant full read and write permissions to all users and everyone.

Install plugins

The first thing you'll need to do after installing the main program is install several plugins. You should see an internal page called "My Studio" when you first bring up the program (if you don't, bring it up by going to Window > My Studio). Then click on "Plugins" and go from there, or click on "View Plugin Manager" to add plugins from there.

Here's a screenshot of how the Plugin Manager looks (usually shows up in the bottom panel):

(Note: In Aptana 2, plugins can be added by selecting Help, Install New Software)

desc
Screenshot of Plugin Manager


Here are the plugins you should install at a minimum:

  • PHP Development Tools
  • Subversive or Subclipse (for SVN)


Here are additional plugins you may want install (optional):

  • Ajax Libraries (all)
  • Smarty Editor
    • Must be downloaded separately from http://code.google.com/p/smartypdt/
    • Before attempting to install, you may need to add the Eclipse file repository so you can gather required components
    • For Aptana Studio 3:
      • Help > Install New Software
      • click the "Available Software Sites" link
      • enable Eclipse Helios Update Site
    • After downloading, follow instructions at http://code.google.com/p/smartypdt/wiki/InstallSmartyPDT
      • Although instructions refer to Eclipse, the exact same steps apply to Aptana Studio
    • Associate *.tpl files with the Smarty editor by doing the following:
      • Go to Window > Preferences > General > Editors > File Associations
      • Add *.tpl as a file association type if necessary
      • Make the Smarty editor the default editor
  • Quantum Database Utility
    • In addition to installing this plugin, you'll need to download and install another file as explained here.
    • Allows you to connect to the MySQL database separately and run queries, etc.

Get used to Perspectives

Instead of showing all features and panels on one screen, Aptana uses "perspectives" that vary the screen and toolbars according to what you're focused on at the moment (for example, debugging, SVN, etc.). You'll need to get used to these so try them out by going to the top right and opening various ones. Here's a screenshot showing where to click to open a new perspective:

 Plugin Image
File not found.


If you've changed the layout of a perspective and you like it, it's a good idea to save it by going to Window > Save Perspective As... and then clicking OK on the popup that comes up (no need to rename unless you want to set up a separate perspective).

Settings

Most settings can be made under Preferences or by right-clicking and selecting properties. On Windows and Linux, Preferences appears under the Window menu; on the Mac it appears under the Aptana Studio menu.

The search box under Preferences is very handy given the number of settings.

Unix Line Delimiters

 Warning
One important setting is to use Unix line delimiters:
  1. Go to Window > Preferences (Mac: Aptana Studio > Preferences)
  2. In the pop-up, select General > Workspace
  3. Under "New text file line delimiter" on that screen, select the "Other" radio button and select "Unix" from the dropdown menu
  4. Click "Apply" and "OK"

This is important - using something other than Unix line delimiters causes fatal errors in Tiki.

External Web Servers

Usually it's best to have a stand-alone browser program launch separately when debugging. Following are the settings needed to effect that:

  1. Go to Window > Preferences (Mac: Aptana Studio > Preferences)
  2. In the pop-up, select General > Web Browser
  3. Check Use external browser
  4. Click Default system Web Browser to use your default browser
  5. Click New... or Edit... to add or edit another browser. In the screen that pops up, add the location and parameter information as described further below for each type of operating system.

Windows

You just need to enter the path the the browser executable file as the location. For example, C:\Program Files\Internet Explorer\iexplore.exe

Mac

For Macs, you can't just use the path to the browser's executable file. Input the following instead:

Browser Location Parameters
Safari /usr/bin/open -a safari %URL%
Firefox /usr/bin/open -a /Applications/Firefox.app %URL%

Here's a screenshot:

 Plugin Image
File not found.


There's more information on debugging-related settings in the debugging section below under Aptana settings.

Add Tiki as a Project

Something like Tiki is best handled as a project in Aptana as described below.

New Tiki Project from SVN

  1. First add the Tiki repository to Aptana by switching to the SVN Repository Exploring perspective (SVN Perspective ) and then going to File > New > Repository Location (Image )
    • In the Enter Repository Location Information window that pops up, enter "https://tikiwiki.svn.sourceforge.net/svnroot/tikiwiki" as the URL for the repository, a custom label (optional) and your SourceForge username and password and then click Finish. Here's a screenshot:

      Enter Repository Info

    This repository that includes all Tiki resources (trunk, branches, etc.) will now be available to choose from for any future Tiki project you want to add to Aptana.

  2. Go to File > New > Project... > SVN > Project from SVN to get the wizard started for selecting a specific Tiki resource for a project:

    Project Wizard - SVN project

  3. After clicking next, make sure the Tiki repository and the Use existing repository location button are selected on the next window (shown below) and click Next:

     Plugin Image
    File not found.


  4. On the next window, click on Browse and select a base resource (such as trunk) on the window that pops up (shown below):

    Select Base Resource

  5. Click OK on the above Select base resource window, which will take you back to the Select Resource window. Make sure Head Revision is selected and then click Finish. Note: If the Finish button is grayed out on the Select Resource window, just click back and forth on the radio buttons under Revision and it should become active.

  6. After selecting the resource, click Finish on the Check Out As popup that comes up in order to "Check out as a project using the New Project Wizard." Here's a screenshot:

     Plugin Image
    File not found.


  7. This should take you back to selecting a project type, this time choose PHP > PHP Project to get this wizard started.
    • The project name you choose on the next screen will also be the name of the folder under xampp

Existing Project

If you already have an XAMPP Tiki installation that you want to use Aptana with, please view this video on how to do that. You'll need to show the "Project Explorer" view to be able to follow the tutorial.

Project Build Path

To provide all the cool code assist features, Aptana does project builds, where background validation and other routines are run. The default is for these to run automatically. You can speed this process up for the initial build by excluding files that won't need debugging (like image files) by doing the following:

  1. Right-click the project folder
  2. Select Build Path > Configure Inclusion / Exclusion Filters...
  3. Click on "Add Multiple" under the Exclusion patterns
  4. Select the folders to exclude. For instance:
    • images, img, pics, temp, templates_c, templates

Hanging during build

[+]

PHP Debugger

One of the main reasons to use a program like Aptana is to be able to debug the code using a debugging program. Below are steps on how to set a debugger up.

Xdebug

  1. Locate the Xdebug file that comes with XAMPP
    The Xdebug file will be in the extension directory, which can be found on the phpinfo page in the "PHP Core" section under extension_dir. (To get to the phpinfo() page, go to localhost/xampp and then click on phpinfo() in the left menu bar). Here's a screenshot showing where the extension directory is:

    Extension directory

    This path will be added to the php.ini file in the steps below.

  2. Open the php.ini file to edit it.
    The location of the file is shown on phpinfo() in the first section as "Loaded configuration file." here's a screenshot:

    Image

  3. Add or uncomment (by removing the semi-colon (;) at the beginning of the line) the following lines in the Xdebug section of the php.ini file. For the first line, use the Xdebug file path identified in step 1.
    Copy to clipboard
    [XDebug] ;Use your actual path and file name for the Xdebug file in the first line. ;The path shown below is a typical Windows path ;- Unix and Mac Xdebug files will be named something like xdebug.so. ;If not using thread safe, then use zend_extension (without the _ts at the end) zend_extension_ts=C:\xampp\php\ext\php_xdebug.dll xdebug.remote_enable=true xdebug.remote_host=127.0.0.1 xdebug.remote_port=9000 xdebug.remote_handler=dbgp xdebug.idekey=ECLIPSE_DBGP

     Warning
    Make sure there are no stray lines anywhere else in the php.ini file, such as extension=php_xdebug.dll (with Windows), which could override the lines above. If there are, comment them out by placing a semi-colon at the beginning of the line.
  4. Restart the server software (Apache, for example). The server software should be restarted anytime changes are made to php.ini.

  5. Final check
    You'll know that Xdebug has been properly installed when you see the following credit at the end of the first info block on the phpinfo page:

    Working Xdebug

(optional) Download another version of Xdebug

[+]

Aptana settings

There are several important settings that need to be made for the debugging functons in Aptana to work:

  1. Check debugger settings
    1. Under the Window menu (Aptana Studio menu with the Mac), go to Preferences > PHP > Debug > Installed Debuggers
    2. Select the debugger you want to configure (Zend or Xdebug) and click on the "Configure" button
    3. For Xdebug, configure the following:
      • Make sure the port is set to 9000 (and that it matches the setting in php.ini)
      • Check "Use Multisession"
        Here's a screenshot:

         Plugin Image
        File not found.


  2. Optionally, associate your PHP executable with a debugger (this may not be necessary)
    This is a bit of a guessing game, but you'll need to locate the file that executes php within xampp.
    • In Windows, it will be a .dll file. With xampp 1.7.1 it was C:\xampp\apache\bin\php5apache2.dll. Starting with 1.7.2 it moved to C:\xampp\php\phpts.dll.
    • With a Mac, in version 1.7.3 the file path was /Applications/XAMPP/xamppfiles/bin/php-5.3.1

    Once you've found it:
    1. Under the Window menu (Aptana Studio menu with the Mac), go to Preferences > PHP > PHP Executables
    2. Click on the "Add..." button and enter the path to the executable and select your debugger (zend or xdebug). Here's a screenshot:

      Add a PHP Executable

  3. Other settings
    There are a ton of settings under Preferences, but here's a couple of key ones:
    • Preferences > PHP > PHP Interpreter: make sure this is set to the PHP version you're using
    • Preferences > PHP > PHP Servers: be sure the Workspace default is set to http://127.0.0.1 or http://localhost
    • Preferences > PHP > Debug > Workbench Options: uncheck Open PHP Debug Views (Debug Output, Browser Output) to keep these views from opening during debugging

Debug Configuration

Now you're ready to set up a debug configuration:

  1. In the "PHP Debug Perspective", click on the debug icon at the top left of the toolbar (it's a little green bug)
  2. Select Debug Configurations...
  3. Click on PHP Web Page in the left tree menu
  4. Click on the "new" button at the top left
  5. Enter a name for the project and a file to be opened. It's usually best to leave this as tiki-index.php and you can navigate from this page to others with the debugger running.
  6. Then click "Apply" and "Debug"
  7. In the future this configuration will be available in the debug dropdown

    Here's a screenshot of the debug configuration window:

    Aptana debug configuration

Tutorial

If you're not familiar with using a debugger to step through code, there's decent beginner tutorial in Aptana help called "Working with the Debugger." Just go to Aptana help and type that phrase in and it gives you the code for a file to debug and walks you through some debugging steps.

Troubleshooting

If the debugger doesn't work in Aptana even though it shows as being installed properly in phpinfo(), you might try the following:

  • Look in the Apatana error log at htdocs/.megadta/.log
  • If you're seeing an error that the debugger can't use a port number (say 10000), and that port number is the same as used for the Zend debugger, then change the Zend debugger's port number to a different number

SVN

Just remember Team. All of the familiar SVN functions (commit, update, switch, etc.) can be accessed by right-clicking on any folder or file and then selecting Team in the context menu.

If you like to watch the files scroll by during an update, you can see that in the console view, which is usually in the bottom panel. If not, you can activate it by going to Window > Show View > Console. If you're still not seeing it, you may need to select SVN in the console selector. Here's a sceenshot:

 Plugin Image
File not found.


The "Show History" option in the Team menu is very useful. Individual revisions for a file can be right-clicked and changes shown versus a previous revision.

There is also an SVN perspective, which allows you to navigate through the repository, among other features.

Keywords

The following is a list of keywords that should serve as hubs for navigation within the Tiki development and should correspond to documentation keywords.

Each feature in Tiki has a wiki page which regroups all the bugs, requests for enhancements, etc. It is somewhat a form of wiki-based project management. You can also express your interest in a feature by adding it to your profile. You can also try out the Dynamic filter.

Accessibility (WAI & 508)
Accounting
Administration
Ajax
Articles & Submissions
Backlinks
Banner
Batch
BigBlueButton audio/video/chat/screensharing
Blog
Bookmark
Browser Compatibility
Calendar
Category
Chat
Comment
Communication Center
Consistency
Contacts Address book
Contact us
Content template
Contribution
Cookie
Copyright
Credits
Custom Home (and Group Home Page)
Database MySQL - MyISAM
Database MySQL - InnoDB
Date and Time
Debugger Console
Diagram
Directory (of hyperlinks)
Documentation link from Tiki to doc.tiki.org (Help System)
Docs
DogFood
Draw -superseded by Diagram
Dynamic Content
Preferences
Dynamic Variable
External Authentication
FAQ
Featured links
Feeds (RSS)
File Gallery
Forum
Friendship Network (Community)
Gantt
Group
Groupmail
Help
History
Hotword
HTML Page
i18n (Multilingual, l10n, Babelfish)
Image Gallery
Import-Export
Install
Integrator
Interoperability
Inter-User Messages
InterTiki
jQuery
Kaltura video management
Kanban
Karma
Live Support
Logs (system & action)
Lost edit protection
Mail-in
Map
Menu
Meta Tag
Missing features
Visual Mapping
Mobile
Mods
Modules
MultiTiki
MyTiki
Newsletter
Notepad
OS independence (Non-Linux, Windows/IIS, Mac, BSD)
Organic Groups (Self-managed Teams)
Packages
Payment
PDF
Performance Speed / Load / Compression / Cache
Permission
Poll
Profiles
Quiz
Rating
Realname
Report
Revision Approval
Scheduler
Score
Search engine optimization (SEO)
Search
Security
Semantic links
Share
Shopping Cart
Shoutbox
Site Identity
Slideshow
Smarty Template
Social Networking
Spam protection (Anti-bot CATPCHA)
Spellcheck
Spreadsheet
Staging and Approval
Stats
Survey
Syntax Highlighter (Codemirror)
Tablesorter
Tags
Task
Tell a Friend
Terms and Conditions
Theme
TikiTests
Federated Timesheets
Token Access
Toolbar (Quicktags)
Tours
Trackers
TRIM
User Administration
User Files
User Menu
Watch
Webmail and Groupmail
WebServices
Wiki History, page rename, etc
Wiki plugins extends basic syntax
Wiki syntax text area, parser, etc
Wiki structure (book and table of content)
Workspace and perspectives
WYSIWTSN
WYSIWYCA
WYSIWYG
XMLRPC
XMPP




Useful Tools