Installation of PHP & Eclipse to debug Mediawiki (Ubuntu)
Start with Installing Ubuntu under VirtualBox
Install apache through apt-get install apache2, compare debian install notes. Install mysql and eclipse 3.5.1 through Ubuntu software management. Install rapache and "root terminal" as well.
Read this: http://wiki.eclipse.org/PDT/Installation and install Sun JVM Ubuntu Software Center, filter "Java", select Sun Java Runtime. In Terminal window run "sudo update-java-alternatives -l" to see the current configuration and possibilities. Run "sudo update-java-alternatives -s java-6-sun" to set to sun version.
Setup Eclipse to use /var/www as workspace - this requires a chmod 777 on /var/www
Eclipse plugins are broken in Ubuntu 9.10 if installing just eclipse platform. In Synaptic install and "eclipse-pde" perhaps "eclipse-jdt" and "ant" (as of Nov. 2009 some packages were incomplete, prevented installing plugins... )
In Eclipse, go to Help, Install New Software. To the right of Available Sites click "Add" and create new entries:
- galileo = "http://download.eclipse.org/releases/galileo"
- PDT = "http://downloads.zend.com/pdt"
- Aptana Studio = "http://update15.aptana.org/studio/26124/"
Then Select "All available sites" on top of form and install:
- Zend CE debugger at the bottom.
Note: to improve image and backup compression, fill unused data blocks with zero-bytes (on any Unix variant - Linux, NetBSD, Solaris, etc.; dangerous: fills disk completely, then system instable! Keep second terminal window open in advance):
dd if=/dev/zero of=/0bits bs=20971520 # bs=20m rm /0bits
On Windows, to compress Virtual Box image, use:
"C:\Program Files\Sun\VirtualBox\VBoxManage.exe" clonehd C:\Users\gh\.VirtualBox\HardDisks\ubuntu.vmdk clone.vmdk
Useful file management and cleanup notes see: http://maketecheasier.com/8-ways-to-maintain-a-clean-lean-ubuntu-machine/2008/10/07 Tips:
Ubuntu: Accessories: Disk Usage Analyzer Ubuntu: System tools: FSLint (needs apt-get install fslint). apt-get install zerofree
OLD from Windows:
- go to http://www.mediawiki.org mediawiki.org and download newest Mediawiki version
- copy sources to htdocs folder under XAMPP installation: XAMPP_INSTALL_PATH/htdocs
- under http://localhost/mediawiki/ it is availabe right now
- follow instructions of Mediawiki installation (enable checkbox superadvisor, because mySQL user:root with empty password is available)
- copy LocalSettings.php to the root folder of your mediawiki installation
Use Eclipse and Zend Debugger
- create new PHP-Project and use 'Creating project from existing source' - destination: XAMPP_INSTALL_PATH/htdocs/mediawiki (because you have to debug the code on the web-server)
- maybe it is necessary to customize: Eclipse -> Window -> Preferences -> PHP -> Debug -> Installed Debuggers -> Zend Debugger -> Client/Host IP
- start debug index.php by using Debug As in the context menu after clicking the file in the Eclipse File browser (use Debug markers/Breakpoints in the source code)
- important: customize run configuration (within the play dropdown) and change the debugger type to Zend Debugger (test for correct working possible)