====== Eclipse IDE ====== The [[http://www.eclipse.org/ide/|Eclipse IDE]] Integrated Development Environment is open source and provides an excellent environment to develop web applications. This guide provides all necessary steps to setup and get it running, and was modified for installation of the following versions: ^ XAMPP | 5.6.32 | 7.2.14 | ^ Eclipse for PHP Developers | Oxygen 1a (4.7.1a) | | ^ PHP | 5.6.32 | 7.2.14 | ^ MariaDB | 10.1.28 | 10.1.36 | ^ MySQL | (5.6.32) | | * [[https://mariadb.com/kb/en/library/mariadb-vs-mysql-compatibility/|MariaDB versus MySQL - Compatibility]] ===== XAMPP ===== ==== Installation ==== * Install [[https://www.apachefriends.org/download.html|XAMPP]] packages on a Linux client through the packet manager or download location. * Install [[https://www.apachefriends.org/download.html|XAMPP]] on a Windows client. Keep all path definitions relative, e.g. without the drive letter, except the reference to the xdebug dll. Make sure xampp is installed to a root directory, e.g. X:\xampp. "X" can be any drive letter available to your system, also a portable one. Besides the reference to the xdebug dll, the installation remains portable. * Install [[https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/|XAMPP Portable]] on a Windows client to integrate into the portable apps environment. ==== Apache ==== Modify x:\xampp\apache\conf\httpd.conf. The best way to integrate with eclipse is to point the DocumentRoot to your project directory: DocumentRoot "x:/joomla/htdocs" Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Require all granted Alternatively, you can keep the default DocumentRoot and add an alias to your project directory: Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Require all granted ScriptAlias /cgi-bin/ "x:/xampp/cgi-bin/" Alias /joomla "x:/joomla/htdocs/" To enable SSL, you need to set the DocumentRoot in C:\xampp\apache\conf\extra\httpd-ssl.confDocumentRoot "x:/joomla/htdocs" ==== PHP ==== - Modify x:\xampp\php\php.ini:output_buffering=off short_open_tag = On max_execution_time=120 max_input_time=150 memory_limit=256M error_reporting=E_ALL & ~E_DEPRECATED & ~E_STRICT display_errors=On post_max_size=16M upload_max_filesize=128M date.timezone=Asia/Bangkok ;extension=php_imap.dll ;extension=php_pdo_odbc.dll - Download [[https://www.phpmyadmin.net/downloads/|phpMyAdmin]] latest version and replace the folder in /xampp - If your htdocs directory is on a different drive than the xampp installation, then you need to either add the drive to "session.save_path" in php.ini, or create an equivalent folder path on the drive where your htdocs folder resides.session.save_path = "C:\xampp\tmp" ==== MariaDB / MySQL ==== - Create user to connect with in your application. Give him sufficient access privileges. - If you have existing projects, copy the database directories and files to x:/xampp/mysql/data. - Create access for your user for host '%' and 'localhost' (2 entries) with the necessary privileges. - Default options are read from the following files in the given order:C:\Windows\my.ini C:\Windows\my.cnf C:\my.ini C:\my.cnf C:\xampp\mysql\my.ini C:\xampp\mysql\my.cnf C:\xampp\mysql\bin\my.ini C:\xampp\mysql\bin\my.cnf === Links === * [[http://stackoverflow.com/questions/1412339/cannot-log-in-with-created-user-in-mysql|Cannot log in with created user in mysql]] * [[https://mariadb.com/kb/en/library/authentication-plugin-unix-socket/|Authentication Plugin - Unix Socket]] * [[https://websiteforstudents.com/mariadb-installed-without-password-prompts-for-root-on-ubuntu-17-10-18-04-beta/|MariaDB Installed Without Password Prompts For Root]] * [[https://mariadb.com/kb/en/library/configuring-mariadb-for-optimal-performance/|Configuring MariaDB for Optimal Performance]] * [[https://stackoverflow.com/questions/17977057/how-do-i-check-my-innodb-settings|How do I check my InnoDB settings?]] * [[https://gist.github.com/nguyenanhtu/33aa7ffb6c36fdc110ea8624eeb51e69|Guide to configure SSL in XAMPP]] ===== Eclipse IDE ===== ==== Java ==== Eclipse requires Java to run, so install this first. * Install Java Runtime Environment [[http://www.filehippo.com/download_jre_32|32 Bit Version]] or [[http://www.filehippo.com/download_jre_64|64 Bit Version]] * If you have recently installed Java 8 and uninstalled older versions, install [[http://www.oracle.com/technetwork/java/javase/downloads/index.html|Java SE Development Kit 8]] and retry. * If you get a [[http://stackoverflow.com/questions/11461607/cant-start-eclipse-java-was-started-but-returned-exit-code-13|Java was started but returned exit code=13]] error, you most likely installed the wrong Java version. Try re-installing Java with the 64-bit version, or vice versa. ==== Eclipse ==== * Install [[http://www.eclipse.org/downloads/|Eclipse for PHP Developers]] * Choose x:\ as installation path, where "x" can be any drive letter available to your system, also a portable one. * [[https://wiki.eclipse.org/FAQ_How_do_I_increase_the_heap_size_available_to_Eclipse%3F|How do I increase the heap size available to Eclipse?]] ==== XDebug for PHP 7.2 ==== To activate the debugger, you need to add the following lines to the bottom of x:/xampp/php/php.ini: [XDebug] zend_extension = "C:\xampp\php\ext\php_xdebug-2.6.1-7.2-vc15.dll" ; IMPORTANT: Windows does not find the dll if the drive letter is missing! xdebug.remote_autostart = 1 xdebug.profiler_append = 0 xdebug.profiler_enable = 0 xdebug.profiler_enable_trigger = 0 xdebug.profiler_output_dir = "\xampp\tmp" ;xdebug.profiler_output_name = "cachegrind.out.%t-%s" xdebug.remote_enable = 1 xdebug.remote_handler = "dbgp" xdebug.remote_host = "127.0.0.1" xdebug.remote_log = "\xampp\tmp\xdebug.txt" xdebug.remote_port = 9000 xdebug.trace_output_dir = "\xampp\tmp" xdebug.remote_cookie_expire_time = 36000 * Other options can be left at default values. Check the settings have been recognized by checking phpinfo. * XAMPP does not contain the correct php_xdebug.dll, download it from [[https://gist.github.com/odan/1abe76d373a9cbb15bed|here]] and put it into folder x:/xampp/php/ext. * Make sure you have Visual C++ 2017 installed. * Download and install: [[https://gist.github.com/odan/1abe76d373a9cbb15bed|Installing Xdebug for XAMPP with PHP 7.x]] and [[https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads|The latest supported Visual C++ downloads]] * Check phpinfo: [[https://xdebug.org/wizard.php|Tailored Installation Instructions]] ==== XDebug for PHP 5.6 ==== To activate the debugger, you need to add the following lines to the bottom of x:/xampp/php/php.ini: [Xdebug] zend_extension=H:\xampp\php\ext\php_xdebug.dll xdebug.remote_enable = 1 xdebug.remote_port = 9000 xdebug.trace_output_dir = "\xampp\tmp" Other options can be left at default values. Check the settings have been recognized by checking phpinfo. xampp comes with the correct php_xdebug.dll file already located in x:/xampp/php/ext. === Links === * [[https://wiki.eclipse.org/Debugging_using_XDebug|Debugging using XDebug]] * [[http://www.eclipse.org/pdt/documents/XDebugGuideForPDT2.0.pdf|XDebug Guide]] * [[https://xdebug.org/docs/remote|XDEBUG EXTENSION FOR PHP - DOCUMENTATION]] * [[https://xdebug.org/wizard.php|Xdebug Support: Tailored Installation Instructions]] ==== JavaScript ==== === Links === * [[https://stackoverflow.com/questions/12269560/javascript-editor-plugin-for-eclipse|JavaScript Editor Plugin for Eclipse]] * [[https://nodejs.org/en/download/|Download Node.js]] * [[https://www.dev2qa.com/how-to-run-debug-node-js-application-with-eclipse/|How To Run / Debug Node.js Application With Eclipse]] ==== TypeScript ==== Install the [[http://typecsdev.com/|TypeScript]] IDE for Eclipse. - Install required software: [[http://www.oracle.com/technetwork/java/javase/downloads/index.html|Java 7]], [[https://www.eclipse.org/downloads/|Eclipse Kepler 4.3]] or higher, [[http://nodejs.org/|Node.js]]. - In Eclipse go to **Help → Install New Software...** - Provide the installation location http://axmor.bitbucket.org/typecs/stable/update-site/ - Mark the plugin version you would like to install then press **Next...** - On Install Details press **Next...** - Review and confirm the plugin to install. - Restart Eclipse. ==== Settings ==== - Go to **Window -> Preferences -> General** and enable "Show heap status". - Go to **Window -> Preferences -> General -> Workspace** and modify the Workspace settings.{{ :web:workspace.jpg?100 |Workspace}} - Go to **Window -> Preferences -> General -> Web browser** and set the desired browser for browser output.{{ :web:webbrowser.jpg?100 |Web browser}} - Go to **Window -> Preferences -> PHP -> Servers** and enter the web server settings.{{ :web:phpserver.jpg?100 |PHP Server}} - Go to **Window -> Preferences -> PHP -> Validation** and set the PHP version.{{ :web:validation.jpg?100 |Validation}} - Go to **Window -> Preferences -> PHP -> Debug -> Debuggers** and check the XDebug settings. They must comply with the settings in the php.ini file. Set "Accept remote session (JIT)" to //off// if you don't want the debugger to automatically start when opening any URL on localhost.{{ :web:xdebug.jpg?100 |XDebug}} - There are three places where the "Break on first line" configuration can be set: * Window -> Preferences -> PHP -> Debug * Project -> Properties -> PHP -> Debug * Run -> Debug Configurations -> PHP Web Application -> -> Debugger - Add or Edit **Debug Configurations...**. If you pointed the DocumentRoot to your workspace, then you can leave the URL on "Auto Generate", otherwise you must modify the URL.{{ :web:debug.jpg?100 |Debug Configuration}} - **Window --> Preferences --> PHP --> Code Style --> Formatter**. Select "PHP Conventions" as active profile.{{ :web:phpconvention.jpg?100 |PHP Formatter}} - If you have existing projects * either select the project directory as workspace when first starting up the new eclipse, or * delete the workspace directories and files (filenames start with "."), then import the project directories with **File --> Import --> General --> Existing Projects into Workspace** === Links === * [[https://stackoverflow.com/questions/3924229/adding-existing-project-folders-to-the-project-explorer-in-eclipse|Adding existing project folders to the project explorer in eclipse]] * [[http://www.iholken.com/index.php/2016/03/15/guide-for-installing-owncloud-9-to-synology-nas-running-dsm-6/|Guide for installing Owncloud 9 to Synology NAS running DSM 6]] * [[https://xpenology.club/install-owncloud-10-on-dsm-6-1/|Install Owncloud 10 on DSM 6.1]] * [[https://www.cs.odu.edu/~zeil/FAQs/Public/win10Bash/|Setting Up a Programming Environment via Windows 10 Bash]] * [[https://stackoverflow.com/questions/844759/eclipse-stuck-when-building-workspace|eclipse stuck when building workspace]]