FAQ:Installing PhpGedView

From PGVWiki
Jump to navigation Jump to search

Questions about installing PhpGedView

How can I reduce the size of the PhpGedView source upload?

You can upload all the PhpGedView source files if you want, but as you gain experience, you might want to remove files you never use prior to uploading them to the web server. This could reduce the size of the upload from around 31MB to around 8MB.

  • In the “work/themes” folder, delete the themes that you do not plan to use. Retain at least “standard” theme.
  • Delete the language files that you do not want. English files are named configure_help.en.php, countries.en.php, facts.en.php, help_text.en.php and lang.en.php. French files, for example, are named with ".fr." in place of ".en.

(The English language files must not be deleted. They are always loaded before the files for the selected language are loaded. This ensures that all language variables are defined, and that the English version will be used when a given variable is missing in the new language.)

  • Do not upload the "places" folder. This folder contains maps for some countries. It also contains text files containing state, county, and place names. Its purpose is to allow you to enter place names by picking them from lists.
  • Go to images/flags and delete the flags from countries other than your own, or the one(s) you want to keep.
  • Check the "modules" folder - it may contain more add-ons than you require. The "extra" folder in the Googlemap module can also be left out for now. If in doubt about what they are or what they do, open the appropriate read-me files and check.

How can I find out if I have PHP on my website, or if I can run php files?

First check the features and support documentation for your website host. Often website hosts offer a variety of hosting packages depending which facilities you want.

If your host doesn't provide this information then you can find out yourself by creating a new text document called test.php and copy the following lines of code into it:

<?php phpinfo() ?>

Upload this new test.php file to your site and point your browser to it. If you have php on your site, you will see a webpage detailing the version of php plus lots of other information - that means that PhpGedView should work. If you don't have php installed then you will see a message similar to the following.

Sorry, no php.

If you are the host server hardware administrator and need to install php then you can download it at http://www.php.net.

What version of PHP is required to run PhpGedView?

PhpGedView requires at least PHP version 4.3.x. Some people are successful at running PhpGedView on PHP v4.2.x but it is not supported by the development team.

To use the reporting engine, PHP needs to be compiled with XML support. This is compiled into PHP by default unless it is specifically disabled. See http://us3.php.net/manual/en/ref.xml.php

Some features of PhpGedView require the GD library and that PHP be compiled with GD support. Most precompiled versions of PHP include GD support. If you are compiling PHP yourself you will need to configure it with the --with-gd option. See http://us3.php.net/manual/en/ref.image.php

The advanced calendar features of PhpGedView for converting Gregorian dates to the Hebrew or Jewish calendars require that PHP be compiled with the --enable-calendar configuration option. See the following website for more information: http://us2.php.net/manual/en/ref.calendar.php

Should I use Index Files or a Database?

PhpGedView prior to Version 4, comes with two options for storing data, databases (like MySQL) and Index files. From Version 4 you can only use a Database.

From the visitor perspective the sites operate in exactly the same way. The Index Files are generated to speed up access of your data. The Database mode imports your gedcom into a database.

Now, the answer to the question, "which one is right for me." The real answer is one of personal preference. Version 4 of PhpGedView has some significant improvements over the previous versions but there are some compelling reasons why one might want to use one an earlier versions with the ability to use index files:

  • If you have a large gedcom file (>5MB) then you should MySQL (or another supported database) for speed and system performance issues. The response time of the standard version seems to increase as the gedcom gets larger.
  • If you don't have a MySQL database on your site or have to pay extra for it then use the Index files.
  • You can always switch to a database and a later version of PhpGedView if you choose to use index modes to start with.

What file permissions need to be set?

All files need read permissions. The following files need write permissions: config.php

The following directory and its contents will need write permissions: ./index/

If you want to use the language editing features you will need to set write permissions for all of the files in the ./languages folder

If you want to upload media files using the upload media section of the admin menu then you need to set write permissions for your ./media and ./media/thumbs directory

If you want to edit your gedcom file online, the gedcom file must have write permissions set for the PHP user.

Refer to the Installation section of readme.txt for more information.

The method to set write permissions varies depending on your server configuration. If you have a Windows server, you may not need to do anything at all. If you use FTP to connect to your server, then you should look for a "permissions" or a "chmod" command. The "chmod" command takes a series of three numbers something like 755. The three numbers tell what permissions are for the file's owner, the file's group, and everyone. So the setting 755 breaks down like this: Owner = 7, Group = 5, Everyone = 5. The following table tells what each number means

7 Read, Write, Execute
6 Read, Write
5 Read, Execute
4 Read
3 Write, Execute
2 Write
1 Execute
0 no access

So the setting 755 would say that for this file, the owner can read, write, and execute the file, the group can read and execute, and everyone can read and execute.

You should first try setting the permissions using "chmod 755". If that doesn't work, that means that the webserver is not setup to run and the files owner and you should try "chmod 775". If that doesn't work, then the webserver is not in the file's group. At this point you can try to change the group (this often requires administrative rights on the server) or you can try "chmod 777". This would give everyone access to the file.

PhpGedView fails when building indexes or importing large GEDCOM files?

There are two problems that could cause this when working with large GEDCOM files (>2MB): insufficient memory and insufficient time.

Insufficient memory

In order to get the information from the GEDCOM file, the file has to be opened and read into memory. PHP has a default memory limit of 8MB. This is a protection from rogue scripts trying to take all of a machine's resources and disabling it. Depending on your PHP version/configuration and if you are importing a large gedcom you should probably double this amount especially while importing or indexing.

A good rule of thumb would be to allocate 4x the size of your gedcom file, though this could be higher. Generally, a 4MB gedcom shouldn't need more than 16MB in PHP. However an 8MB gedcom could require up to 32MB. One user's actual 11MB gedcom file required about 150 Mb.

memory_limit is not supported on Windows of PHP (e.g. there is no memory limit there)

Edit php.ini

The easiest option for increasing memory is to edit php.ini. However, this is only usually possible if you are the server administrator. To change the amount of memory allocated to PHP, edit the php.ini file (most likely located in /etc/php.ini on Unix) and change the following line:

memory_limit = 8M

to

memory_limit = 16M

After editing the php.ini file you need to restart your webserver.

Edit PhpGedView source files

If you do not have access to edit the php.ini file, you can also edit the PhpGedView directory "include/functions.php" file and the "importgedcom.php" files and add as the second line in both files: ini_set("memory_limit", "16M")

Workaround

As an alternate to increasing memory, first try skipping the cleanup options on Step #3. If that doesn't work try to do the GEDCOM importing/indexing on your home computer or split your one large GEDCOM into several smaller GEDCOMs.

Insufficient time

Another problem that can occur, especially on Windows machines, is the time limit can run out. PHP has a default time limit of 30 seconds for script execution. Again this is a security measure to prevent rogue scripts and hackers from stalling a machine. You will usually get an error message if you exceed the time limit. You can change the time limit by editing the time limit parameter in the gedcom configuration.

It should never take more than 10 minutes. After you have built the indexes or imported into the database, you should restore this time limit to 30 seconds to prevent someone from trying to get a 40 generation pedigree chart and stalling your server for 10 minutes.

Can I build the indexes on my Home computer and then upload them?

Yes. This can be helpful for large gedcoms where building an index can take a very long time. You have two options to be able to do this. First you can use the PHPLauncher to run PhpGedView and build your indexes and configuration files. Just copy the index directory from the PHPLauncher and upload it to the PhpGedView directory on your webserver.

You can also download and use PHP to create the indexes. Follow these steps:

  • Download and install PHP.
  • Download and install PhpGedView as if you were installing it on your site.
  • Open a command prompt and go to the PhpGedView directory.
  • Run the command: C:\PHP\php -q buildindex.php (This will build the indexes on your local computer.)
  • When it is done upload the indilist.ind, famlist.ind, and sourcelist.ind to from the PhpGedView/index/ directory on your local computer to the PhpGedView/index/ directory on your server. PhpGedView on the server will automatically recognize the new indexes and use them.

I imported married names in the import step. Why do they do not display?

You have to set "Show married names on Individual list" to Yes. To do this go to:
Admin > Manage GEDCOMs and edit Privacy > Configuration file > Edit > Display and Layout > Names >

I setup PhpGedView but the charts are empty and/or I get some errors?

This usually means that your GEDCOM import did not complete properly. You should try to import the GEDCOM again by logging in as an administrator and going to the Admin page and then the Manage Gedcoms area. Then click on the import link next to the GEDCOM you need to import. If you are asked to cleanup your Gedcom, you should click the "Cleanup" button. If you are asked to empty the dataset click the "Yes" button.

As your Gedcom is imported, your will see a progress bar telling you what percentage of your Gedcom has been imported, as well as a progress bar showing the percentage of the time limit used. When the importing is finished you should see several statistical messages and links off to the right that will take you to some of the other pages.

If you do not get this information or if you get errors then you should look at some of the other FAQ's on this page for more information on how to proceed from here. If your question is not answered here, then you should post a message in the help forums.