1[![Latest Stable Version](https://poser.pugx.org/fisharebest/webtrees/v/stable.svg)](https://packagist.org/packages/fisharebest/webtrees) 2[![Latest Unstable Version](https://poser.pugx.org/fisharebest/webtrees/v/unstable.svg)](https://packagist.org/packages/fisharebest/webtrees) 3[![License](https://poser.pugx.org/fisharebest/webtrees/license)](https://packagist.org/packages/fisharebest/webtrees) 4[![Build Status](https://travis-ci.org/fisharebest/webtrees.svg?branch=master)](https://travis-ci.org/fisharebest/webtrees) 5[![Coverage Status](https://coveralls.io/repos/github/fisharebest/webtrees/badge.svg?branch=master)](https://coveralls.io/github/fisharebest/webtrees?branch=master) 6[![Translation status](https://weblate.iet.open.ac.uk/widgets/webtrees/-/svg-badge.svg)](https://weblate.iet.open.ac.uk/projects/webtrees/webtrees/) 7[![SensioLabsInsight](https://insight.sensiolabs.com/projects/78a5ba19-7ddf-4a58-8262-1c8a149f38de/mini.png)](https://insight.sensiolabs.com/projects/78a5ba19-7ddf-4a58-8262-1c8a149f38de) 8[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/fisharebest/webtrees/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/fisharebest/webtrees/?branch=master) 9[![Code Climate](https://codeclimate.com/github/fisharebest/webtrees/badges/gpa.svg)](https://codeclimate.com/github/fisharebest/webtrees) 10[![StyleCI](https://github.styleci.io/repos/11836349/shield?branch=master)](https://github.styleci.io/repos/11836349) 11 12# webtrees - online collaborative genealogy 13 14The project’s website is [www.webtrees.net](https://www.webtrees.net). 15Further documentation is available at [wiki.webtrees.net](https://wiki.webtrees.net) and [webtrees.github.io](https://webtrees.github.io). 16 17## Contents 18 19* [License](#license) 20* [Coding styles and standards](#coding-styles-and-standards) 21* [Introduction](#introduction) 22* [System requirements](#system-requirements) 23* [Internet browser compatibility](#internet-browser-compatibility) 24* [Installation](#installation) 25* [Upgrading](#upgrading) 26* [Building and developing](#building-and-developing) 27* [Gedcom (family tree) files](#gedcom-family-tree-files) 28* [Security](#security) 29* [Backup](#backup) 30 31 32## License 33 34* **webtrees: online genealogy** 35* Copyright 2019 webtrees development team 36 37This program is free software: you can redistribute it and/or modify 38it under the terms of the GNU General Public License as published by 39the Free Software Foundation, either version 3 of the License, or 40(at your option) any later version. 41 42This program is distributed in the hope that it will be useful, 43but WITHOUT ANY WARRANTY; without even the implied warranty of 44MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 45GNU General Public License for more details. 46 47You should have received a copy of the GNU General Public License 48along with this program. If not, see <http://www.gnu.org/licenses/>. 49 50## Coding styles and standards 51 52webtrees follows the [PHP Standards Recommendations](https://www.php-fig.org/psr). 53 54* [PSR-1](https://www.php-fig.org/psr/psr-1) - Basic Coding Standard 55* [PSR-2](https://www.php-fig.org/psr/psr-2) - Coding Style Guide 56* [PSR-4](https://www.php-fig.org/psr/psr-4) - Autoloading Stardard 57* [PSR-7](https://www.php-fig.org/psr/psr-7) - HTTP Message Interface 58* [PSR-11](https://www.php-fig.org/psr/psr-11) - Container Interface 59* [PSR-12](https://www.php-fig.org/psr/psr-12) - Extended Coding Style Guide 60* [PSR-15](https://www.php-fig.org/psr/psr-15) - HTTP Handlers 61* [PSR-16](https://www.php-fig.org/psr/psr-16) - Simple Cache 62* [PSR-17](https://www.php-fig.org/psr/psr-17) - HTTP Factories 63 64We do not currently use [PSR-3 (logging)](https://www.php-fig.org/psr/psr-3) - but we plan to do so in the future. 65 66## Introduction 67 68**webtrees** is the web's leading online collaborative genealogy application. 69 70* It works from standard GEDCOM files, and is therefore compatible with every 71major desktop application. 72* It aims to to be efficient and effective by using the right combination of 73third-party tools, design techniques and open standards. 74 75**webtrees** allows you to view and edit your genealogy on your website. It has 76full editing capabilities, full privacy functions, and supports imedia such as 77photos and document images. As an online program, it fosters extended family 78participation and good ancestral recording habits, as it simplifies the process 79of collaborating with others working on your family lines. Your latest information 80is always on your web site and available for others to see, defined by viewing 81rules you set. For more information and to see working demos, visit 82[webtrees.net](https://webtrees.net/). 83 84**webtrees** is Open Source software that has been produced by people from many 85countries freely donating their time and talents to the project. All service, 86support, and future development is dependent on the time developers are willing 87to donate to the project, often at the expense of work, recreation, and family. 88Beyond the few donations received from users, developers receive no compensation 89for the time they spend working on the project. There is also no outside source 90of revenue to support the project. Please consider these circumstances when 91making support requests and consider volunteering your own time and skills to make 92the project even stronger and better. 93 94 95## System requirements 96 97To install **webtrees**, you need: 98 99* A webserver. Apache, NGINX and IIS are the most common types. There are no 100 requirements to use a specific type or version. 101* Approximately 65MB of disk space for the application files, plus whatever is 102 needed for your media files, GEDCOM files and database. 103* PHP 7.0 or later. Servers with PHP 5.3 - 5.6 should use **webtrees** 1.7. 104 Servers with PHP 5.2 should use **webtrees** 1.4. 105 * PHP should be configured with the following libraries: 106 * PDO and pdo_mysql to enable access to MySQL. These are enabled by default 107 on most hosts. See [http://php.net/pdo](http://php.net/pdo), 108 * php\_gd(2) for images 109 * PHP_XML for reports. 110 * PHP should be configured to allow sufficient server resources (memory and 111 execution time) for the size of your system. Typical requirements are: 112 * Small systems (500 individuals): 16–32 MB, 10–20 seconds 113 * Medium systems (5,000 individuals): 32–64 MB, 20–40 seconds 114 * Large systems (50,000 individuals): 64–128 MB, 40–80 seconds 115* MySQL or MariaDB. Note that **webtrees** can share a single database 116 with other applications, by choosing a unique table prefix during setup. 117 If the number of databases is not restricted, you can set up a database purely 118 for use by **webtrees** and create a separate user and password for only 119 your genealogy. 120 121 122 ## Internet browser compatibility 123 124 **webtrees** supports the use of most current browsers such as Edge, Firefox, 125 Chrome, and Safari. We will do our best to support the current versions of others 126 such as Opera and Internet Explorer, however note that versions of Internet Explorer 127 prior to IE11 do not work with **webtrees**. We strongly recommend anyone using an 128 obsolete browser to upgrade as soon as possible. We are also aware that Internet 129 Explorer provides poor RTL language support generally, so cannot recommend it for 130 sites requiring RTL languages. 131* To view sites that contain both left-to-right and right-to-left text (e.g. 132 English data on Hebrew pages), you will need to use a browser that provides 133 support for the HTML5 **dir="auto"** attribute. At present, neither Edge 134 nor Internet Explorer support this. 135 136 137## Installation 138 139Once the system requirements are met, perform the following steps 140 1411. Download the latest stable version from [github.com](https://github.com/fisharebest/webtrees/releases/latest) 1422. Unzip the files and upload them to an empty folder on your web server. 1433. Open your web browser and type the URL for your **webtrees** site (for example, 144 ``http://www.yourserver.com/webtrees`` into the address bar. 1454. The **webtrees** setup wizard will start automatically. Simply follow the steps, 146 answering each question as you proceed. 147 148That's it! 149 150However, before you can use **webtrees**, you need at least one GEDCOM 151(family tree) file. If you have been doing your research using a desktop program 152such as Family Tree Maker, you can use it's “save as GEDCOM” function to create 153a GEDCOM file. If you are starting from scratch, then **webtrees** can create a 154GEDCOM file for you. 155 156On successful installation you will be taken to the 157 ``Control panel`` -> ``Manage family trees`` page where you can: 158 * UPLOAD a GEDCOM file from your local machine 159 * ADD a GEDCOM file from your server, (if your GEDCOM file is too large to upload, 160 you can copy it to the webtrees/data folder, and load it from there) 161 * CREATE a new, empty GEDCOM file 162 163There are *lots* of configuration options. You'll probably want to review the 164privacy settings first. Don't worry too much about all the other options - the 165defaults are good for most people. If you get stuck, there's lots of built-in 166help and you can get friendly advice from the [help](https://webtrees.net/forums) 167forum. 168 169 170## Upgrading 171 172Upgrading **webtrees** is quick and easy. It is strongly recommended that you 173upgrade your installation whenever a new version is made available. Even minor 174**webtrees** version updates usually contain a significant number of bug fixes 175as well as interface improvements and program enhancements. 176 177* **Automatic upgrade** 178 179 **webtrees** has an automatic upgrade facility. An administrator upon logging in 180will receive notification when a new version is available and an option to start 181the automatic upgrade. If for some reason the automatic upgrade should fail 182then a manual upgrade should be performed. 183 184* **Manual upgrade** 185 186 1. Now would be a good time to make a [backup](#backup). 187 2. Download the latest version of **webtrees** available from 188 [webtrees.net](https://webtrees.net/) 189 3. While you are in the middle of uploading the new files, 190 a visitor to your site would encounter a mixture of new and old files. This 191 could cause unpredictable behavior or errors. To prevent this, create the 192 file **data/offline.txt**. While this file exists, visitors will see a 193 “site unavailable - come back later” message. 194 4. Unzip the .ZIP file, and upload the files to your web server, overwriting the existing files. 195 5. Delete the file **data/offline.txt** 196 197 198### Note for Macintosh users 199 200Step 4 assumes you are using a copy tool that **merges** directories rather than 201replaces them. (**Merge** is standard behavior on Windows and Linux.) If you use 202the Macintosh Finder or other similar tool to perform step 3, it will **replace** 203your configuration, media and other directories with the empty/default ones from 204the installation. This would be very bad (but you did take a backup in step 1, 205didn't you!). Further details and recommendations for suitable tools can be found 206by searching [google.com](http://google.com). 207 208 209### Note for anyone using custom code (modules, themes, etc.). 210 211It is **very likely** that your custom code will not work when you upgrade 212**webtrees**. 213 214**We recommend that you disable all custom code before you apply the upgrade.** 215 216Disable custom modules, switch over to a standard theme, and remove any code “hacks”. 217Once the upgrade is complete and you are satisfied that your site is fully operational contact 218the source of those modules or themes for a new version. 219 220 221### General note 222 223Depending on the changes in the new files, your browser configuration 224and possibly other factors, it is always wise to clear both the **webtrees** cache 225and your browser cache immediately after the upgrade is completed. The **webtrees** 226cache can be cleared simply by going to ``Control Panel`` -> ``Family Trees`` -> 227``Clean-up data folder`` and deleting the cache. 228 229If you have any problems or questions, help is available on the 230[webtrees forum](https://www.webtrees.net/index.php/en/forum). 231 232## Building and developing 233 234If you want to build webtrees from source, or modify the code, you'll need to install 235a couple of tools first. 236 237You will need [composer](https://getcomposer.org/) to install the PHP dependencies. 238Then run this command:: 239 240* php composer.phar install 241 242You will need [npm](https://www.npmjs.com/get-npm) to install the Javascript dependencies. 243Then run the commands: 244 245* npm install 246* npm run production 247 248You will need to re-run the second of these any time you modify the file `webtrees.js`. 249 250## Gedcom (family tree) files 251 252When you ADD or IMPORT a family tree (GEDCOM) file in **webtrees** the 253data from the file is transferred to the database tables. The file itself 254remains in the **webtrees/data** folder and is no longer used or required 255by **webtrees**. Any subsequent editing of the **webtrees** data 256will not change this file 257 258When or if you change your genealogy data outside of **webtrees**, it is not 259necessary to delete your GEDCOM file or database from **webtrees** and start 260over. Follow these steps to update a GEDCOM that has already been imported: 261 262* Go to ``Control panel`` -> ``Manage family trees`` On the line relating to this particular family tree (GEDCOM) 263 file (or a new one) select IMPORT. 264* Take careful note of the media items option (_“If you have created media objects 265 in **webtrees**, and have edited your data off-line using software that 266 deletes media objects, then tick this box to merge the current media objects 267 with the new GEDCOM.”_) In most cases you should leave this box **UNCHECKED**. 268* Click “SAVE”. **webtrees** will validate the GEDCOM again before importing. 269 During this process, **webtrees** copies your entire family tree (GEDCOM file) 270 to a 'chunk' table within your database. Depending on the coding of your file, 271 its file size and the capabilities of your server and the supporting software, 272 this may take some time. **No progress bar will show while the data is being 273 copied** and should you navigate away from this page, the process is suspended. 274 It will start again when you return to the Family Tree management page. 275 276 277### Gedcom file Formats 278 279Every Family History program has its own method of creating GEDCOM files, and 280differing output format options to select from. **webtrees'** import routines 281can read many different formats, but not necessarily all. If your software has 282a “UTF8” option you should always use that. However, **webtrees** has been 283tested with these alternative formats: 284 285* ANSI 286 * imports OK, but is slow due to the translation into UTF8 as part 287 of the import process. 288* MAC 289 * imports OK, but is slow due to the translation into UTF8 as part 290 of the import process. 291* DOS 292 * imports OK, but is slow due to the translation into UTF8 as part 293 of the import process. 294* ANSEL 295 * currently will not import. Gives warning *Error: cannot convert 296 GEDCOM file from ANSEL encoding to UTF-8 encoding*. Later releases 297 of **webtrees** may include the facility to translate from ANSEL to UTF8, 298 but for now a standalone utility [is available here](https://dev.webtrees.net/ansel/) 299 and should be used to convert the format to UTF-8 prior to importing. 300 301 302## Security 303 304**Security** in _webtrees_ means ensuring your site is safe from unwanted 305intrusions, hacking, or access to data and configuration files. The developers 306of _webtrees_ regard security as an extremely important part of its development 307and have made every attempt to ensure your data is safe. 308 309The area most at risk of intrusion would be the **/data** folder that contains your 310config.ini.php file, and various temporary files. If you are concerned there 311may be a risk there is a very simple test you can do: try to fetch the file 312config.ini.php by typing **``url_to_your_server/data/config.ini.php``** in your web 313browser. 314 315The most likely result is an “access denied” message like this: 316 317 Forbidden 318 319 You don't have permission to access /data/config.ini.php on this server. 320 321This indicates that the protection built into **webtrees** is working, and no 322further action is required. 323 324In the unlikely event you do fetch the file (you will just see a semicolon), 325then that protection is not working on your site and you should take some further 326action. 327 328If your server runs PHP in CGI mode, then change the permission of the **/data** 329folder to 700 instead of 777. This will block access to the httpd process, 330while still allowing access to PHP scripts. 331 332This will work for perhaps 99% of all users. Only the remaining 1% should consider 333the most complex solution, moving the **/data** folder out of accessible web 334space. (**_Note:_** In many shared hosting environments this is not an option anyway.) 335 336If you do find it necessary, following is an example of the process required: 337 338If your home folder is something like **/home/username**, 339and the root folder for your web site is **/home/username/public_html**, 340and you have installed **webtrees** in the **public_html/webtrees** folder, 341then you would create a new **data** folder in your home folder at the same 342level as your public_html folder, such as **/home/username/private/data**, 343and place your GEDCOM (family tree) file there. 344 345Then change the **Data folder** setting on the ``Control panel`` -> 346``Website`` -> ``Website preferences`` page from the default **data/** to the new 347location **/home/username/private/data** 348 349You will have **two** data directories: 350 351* [path to webtrees]/data - just needs to contain config.ini.php 352* /home/username/private/data - contains everything else 353 354 355## Backup 356 357Backups are good. Whatever problem you have, it can always be fixed from a good 358backup. 359 360To make a backup of **webtrees**, you need to make a copy of the following 361 3621. The files in the *webtrees/data* folder. 3632. The files in the *webtrees/media* folder. 3643. The tables in the database. Freely available tools such as 365 [phpMyAdmin](http://www.phpmyadmin.net) allow you to do this in one click. 366 367Remember that most web hosting services do NOT backup your data, and this is 368your responsibility. 369