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