cancel
Showing results for 
Search instead for 
Did you mean: 

Install PhpGedView 424

appleshaw
Grafter
Posts: 32
Registered: ‎03-07-2008

Install PhpGedView 424

I used to have a version of PGV on the old system but decided to try a later version. Starting easily (I hoped) with 4.1.7 but could never get beyond stage 3. It said database created but Next took me back to stage 2
Have now taken the plunge with 4.2.4  Tried to read all posts but they are not al completely clear for an ancient. File permissions are obviously critical and there seems to be some difference between what Plus will allow and PGV prefers for installation. Suggestions that scripts need one permission doe not help when you do not know what they are. Any pointers to the different type of file/permission would be generally helpful here.
Setting all files to 750, apart from config.php and index I can start the installation but with an alarming set of Error or Warning messages. There are 7 ERROR 2 messages but the output says
Checking for warnings...
Passed
All warning checks passed.
Despite these warnings I got through to save Config (Had to enter port no. 3306 to get that far) but then hit, in Create admin user, the problem pasted below.
Thoughts; is this due to a PDO being missing (I assume it is default); are my permissions (750) wrong in some places; or is it looking for a tmp directory? In config.php the $PGV_SESSION_SAVE_PATH = ""; note says the default will be used as set by php.ini - which I do not have. I understand there is a Plus default but do I need additions?
Any thoughts appreciated. When finished perhaps we can construct a definitive (for dummies) installation guide
Fatal error: Uncaught exception 'PDOException' with message 'No Connection Established' in /share/storage/01/ap/appleshaw/pgv424/includes/classes/class_pgv_db.php:704 Stack trace: #0 /share/storage/01/ap/appleshaw/pgv424/includes/functions/functions_db.php(2630): PGV_DB::prepare('SELECT COUNT(*)...') #1 /share/storage/01/ap/appleshaw/pgv424/includes/functions/functions_db.php(2770): get_admin_user_count() #2 /share/storage/01/ap/appleshaw/pgv424/includes/authentication.php(249): admin_user_exists() #3 /share/storage/01/ap/appleshaw/pgv424/install.php(1049): adminUserExists() #4 /share/storage/01/ap/appleshaw/pgv424/install.php(462): printAdminUserForm() #5 {main} thrown in /share/storage/01/ap/appleshaw/pgv424/includes/classes/class_pgv_db.php on line 704
ERROR 2: Unknown: open(/tmp/sess_346a05ac904ccf97d16428ecd93bf0ac, O_RDWR) failed: File too large (27)
0 Error occurred on
Warning: Unknown: open(/tmp/sess_346a05ac904ccf97d16428ecd93bf0ac, O_RDWR) failed: File too large (27) in Unknown on line 0
ERROR 2: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp)
0 Error occurred on
Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
Peter Beaven
6 REPLIES 6
7up
Community Veteran
Posts: 15,824
Thanks: 1,579
Fixes: 17
Registered: ‎01-08-2007

Re: Install PhpGedView 424

There have been reports in this forum that /tmp#s diskspace is full. See these threads which contain workarounds:
http://community.plus.net/forum/index.php/topic,92023.0.html
http://community.plus.net/forum/index.php/topic,93035.0.html
I need a new signature... i'm bored of the old one!
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: Install PhpGedView 424

Quote from: appleshaw
Have now taken the plunge with 4.2.4  Tried to read all posts but they are not al completely clear for an ancient. File permissions are obviously critical and there seems to be some difference between what Plus will allow and PGV prefers for installation. Suggestions that scripts need one permission doe not help when you do not know what they are. Any pointers to the different type of file/permission would be generally helpful here.

If you are seeking information on how Linux file permissions work, the best source is a Google search. For Plusnet's ccgi platform required file permissions are explained in the CGI platform PHP upgrade FAQ support library document. Despite anything that the PGV documentation says *no files* should be made writeable by anyone other than the owner, even on a temporary basis. Doing that will violate the suEXEC security model (see the FAQ), and just about everything is likely to stop working.
To sort permissions out I suggest using your FTP program to set *all* file permissions to 0640 (using a facility that might be called recurse into subdirectories). Then use the script mentioned in the FAQ to set PHP file permissions to 0700 and directory permissions to 0710. Later it might be necessary to set some directories to 0750 (those associated with uploaded information), but that can be done where needed.
As okrzynska posted the execution error messages are associated with lack of space in /tmp used for saving session information and the workaround is to allocate your own by setting session.save_path in a private copy of php.ini (see those links). If you put that in your top level directory (permissions 0640) the following script will add a link to it into all subdirectories (apart from the session directory itself).
[code=linkphpini.cgi]#!/bin/bash
echo -e -n "Content-type: text/plain\n\n"
currdir=`pwd`
if [ ! -e ./php.ini ] ; then
  echo "./php.ini file not found in $currdir"
  exit 1
fi
pipath="$currdir/php.ini"
sessdir=`awk -F "/" '/^[ \t]*session.save_path *=/ \
  { gsub(/[ \t\r\n]/,"",$NF); printf("%s", $NF) }' ./php.ini`
if [ -z "$sessdir" ] ; then
  echo "session save directory definition not found in ./php.ini"
exit 2
fi
echo -e "adding links to '$pipath'\ninto directories other than './$sessdir'"
find . -mindepth  1 -type d \( -name "$sessdir" -prune -o -print \) | \
  while read i; do echo "  $i"; ln -s "$pipath" $i; done
echo "done"[/code]
Upload this as linkphpini.cgi alongside php.ini, set permissions to 0700 and run by browsing to it.
Hope this moves installation forward.
David
David
appleshaw
Grafter
Posts: 32
Registered: ‎03-07-2008

Re: Install PhpGedView 424

David
Thanks for encouragement. Things have changed but not made progress. In summary
I created a temp directory, to avoid confusion with tmp
Downloaded the php.ini file and amended the line to
  session.save_path = /temp
ran linkphpini.cgi which starts:-
adding links to '/share/storage/01/ap/appleshaw/php.ini'
into directories other than './temp'
also ran update.cgi to set permissions.
Run through installation but does not save the configuration data, because:-
Fatal error: Uncaught exception 'PDOException' with message 'No Connection Established' in /share/storage/01/ap/appleshaw/pgv/includes/classes/class_pgv_db.php:704 Stack trace: #0 /share/storage/01/ap/appleshaw/pgv/includes/functions/functions_db.php(2630): PGV_DB::prepare('SELECT COUNT(*)...') #1 /share/storage/01/ap/appleshaw/pgv/includes/functions/functions_db.php(2770): get_admin_user_count() #2 /share/storage/01/ap/appleshaw/pgv/includes/authentication.php(249): admin_user_exists() #3 /share/storage/01/ap/appleshaw/pgv/install.php(1049): adminUserExists() #4 /share/storage/01/ap/appleshaw/pgv/install.php(462): printAdminUserForm() #5 {main} thrown in /share/storage/01/ap/appleshaw/pgv/includes/classes/class_pgv_db.php on line 704
ERROR 2: Unknown: open(/tmp/sess_264c3ec82d26b7dd7b9b62b738f20e35, O_RDWR) failed: File too large (27)
0 Error occurred on
Warning: Unknown: open(/tmp/sess_264c3ec82d26b7dd7b9b62b738f20e35, O_RDWR) failed: File too large (27) in Unknown on line 0
ERROR 2: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp)
0 Error occurred on
Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
So what am I missing? The error messages refer to tmp. Does this mean the session data reference should be from root, not relative to my directory>
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: Install PhpGedView 424

Yes, as you suggested the session.save_path needs to be the full path from the server root to your session save directory, ie
session.save_path = /share/storage/01/ap/appleshaw/temp
Your entry will have tried to use /temp within the server file system and been unsuccessful!
Changing this in your copy of php.ini should be all that is required, I think the links will have been set correctly as will permissions. One way to check if php.ini is being used properly is to create a file called php_info.php containing just the 3 lines
[code=php_info.php]
<?php
phpinfo();
?>[/code]
Upload this alongside php.ini, change file permissions to 0700 and browse to it. This should list the PHP environment with the content of the Loaded Configuration File line near the top listing the path to your php.ini file and session.save_path in the session block lower down pointing to your temp directory.
You could also try this in a subdirectory other than a PGV one, if you have any, to verify the links work. If you try it in a PGV subdirectory I don't think it will run because the PGV distribution puts .htaccess files in each subdirectory to deny browser access (data security I guess).
David
appleshaw
Grafter
Posts: 32
Registered: ‎03-07-2008

Re: Install PhpGedView 424

Thanks to you all; have loaded the installation  Now back to the genealogy.
It was great to start the initial log-in without seeing a load of error messages all round the PGV menu.
When everything is sorted I will put a summary of what is needed here
Peter Beaven
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: Install PhpGedView 424

That's good news, glad to hear you got the application installed.
When/if you try to upload files using PGV you might have problems:
a) associated with it trying to use /tmp for temporary storage (that should be fixable by changing a php.ini setting);
b) with directory permissions (again fixable once any problem directories are identified).
If these crop up by all means post here if you wish.
David
David