Jump to content

sylvest

Members
  • Content Count

    107
  • Joined

  • Last visited

Community Reputation

2 Neutral

About sylvest

  • Rank
    Distant Family

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I have developed a Python/Selenium script to automate some web operations that I need to do. I have this successfully running on my local PC. Can I upload this to TCH and run it there, so that I can then give other users access to it? This would seem to require a browser (I'm currently using Chrome) to be running on TCH (maybe headlessly) so that Selenium can send commands to it. Can this be done? How? Thanks - Rowan
  2. I am searching for the best way of storing, cataloguing and making available all the family history related photographs that I have. I have literally thousands of photos passed down to me from my parents and grandparents, many going back into the 19th century. I am slowly progressing with digitising these, and photoshopping them to remove the most obvious blemishes and deteriorations. I would like to make these available to me and to members of my family and their descendants now and in the future. Ideally for each image I would like to store: Date of photo Who took it What the event (if any) was (e.g wedding, picnic, tennis match) List of people in the photo, with each of their ages at the time (or this can be worked out on the fly from the date of the photo and the birth date of the person). Place Things of interest shown in the photo Caption Where I got it from, and where the master photo is now (i.e. source and repository) Quality rating Interest rating (maybe this comes by letting each viewer of the image give it a star rating) Activity (e.g. scouting, camping, hiking, sailing) Ideally I would like the system to have some kind of automatic facial recognition function to make it easier to give every face in the pictures the right name. I am already using Tag That Photo to do this on my photo collection, which works reasonably well. Then I would like users to be able to select photos that meet a set of criteria (e.g. all the pictures of my grandparents when they were in their 20s, or all pictures of my ancestors in India), and to sort them as they wish (e.g. by age of the main person, or by date taken, or by surname of people)). I don't want to have to upload the masters of all my pictures to the internet, since these are an invaluable resource. So I want to keep the master on my local system here (which is regularly backed up). But ideally the system should be available via the internet, maybe as part of my family history site generated by John Cardinal's Second Site program from my database in The Master Genealogist. Can you recommend a good way of doing this, and good software to use? Or point me to sample web sites that offer this sort of functionality? Do any of the gallery programs offered by Softaculous offer the ability to filter and sort photos using IPTC and/or EXIF tags? That seems to be the best way to go... Thanks - Rowan
  3. I'm having a problem on a website that I develop. It seems that sometimes when I call session_start(), it fails to find a previously opened session, and opens a new one, which means that I lose all my session variables. Here's a section of log: [27-Feb-2020 17:39:43.496 GMT 0] on localhost, L_TRACE MemberId 18 attempted to login with PasswordStatus = 4 at line 169 in file: /home/sylvest/public_html/swchoir/do_login.php [27-Feb-2020 17:39:43.497 GMT 0] on localhost, L_TRACE Session ID = qdgs4obtlicrlcgnp6tc179e87, $_SESSION = {"breadcrumbs":[{"shortname":"Login", "filename":"index.php"}], "request_index":2, "test_mode":0, "username_entered":"sasb", "login_member":null, "login_memberid":"18", "login_name":"Sue Sylvester-Bradley", "auth_level":0, "return_page":"\/swchoir\/do_login.php", "edit_member_msg":"Your password has expired, and you need to choose a new one before you can access these pages. Please do that now.", "edit_memberid":"18", "edit_member_mode":"change_password"} at line 319 in file: /home/sylvest/public_html/swchoir/do_login.php [27-Feb-2020 17:39:43.497 GMT 0] on localhost, L_TRACE Send cookie username_entered:sasb succeeded at line 334 in file: /home/sylvest/public_html/swchoir/do_login.php [27-Feb-2020 17:39:43.497 GMT 0] on localhost, L_TRACE $to_page = edit_member.php?v=1582819873 at line 1200 in file: /home/sylvest/include/functions.php Called from redirect(edit_member.php?v=1582819873) at line 339 in file /home/sylvest/public_html/swchoir/do_login.php [27-Feb-2020 17:39:43.497 GMT 0] on localhost, L_TRACE Redirecting to Location: https://sylvesterbradley.org/swchoir/edit_member.php?v=1582819873 using header at line 1201 in file: /home/sylvest/include/functions.php Called from redirect(edit_member.php?v=1582819873) at line 339 in file /home/sylvest/public_html/swchoir/do_login.php [27-Feb-2020 17:39:43.817 GMT 0] on L_TRACE Started file at line 37 in file: /home/sylvest/public_html/swchoir/edit_member.php [27-Feb-2020 17:39:43.817 GMT 0] on L_TRACE Started file at line 5 in file: /home/sylvest/include/basic_init.php [27-Feb-2020 17:39:43.817 GMT 0] on L_TRACE Started file at line 4 in file: /home/sylvest/include/functions.php [27-Feb-2020 17:39:43.817 GMT 0] on L_TRACE Started file at line 13 in file: /home/sylvest/include/log_functions.php [27-Feb-2020 17:39:43.818 GMT 0] on , L_TRACE Resumed file at line 9 in file: /home/sylvest/include/functions.php Called from require_once(/home/sylvest/include/functions.php) at line 129 in file /home/sylvest/include/basic_init.php Called from require(/home/sylvest/include/basic_init.php) at line 128 in file /home/sylvest/public_html/swchoir/edit_member.php [27-Feb-2020 17:39:43.818 GMT 0] on , L_TRACE Resumed file at line 140 in file: /home/sylvest/include/basic_init.php Called from require(/home/sylvest/include/basic_init.php) at line 128 in file /home/sylvest/public_html/swchoir/edit_member.php [27-Feb-2020 17:39:43.818 GMT 0] on , L_TRACE session_status() = PHP_SESSION_NONE at line 782 in file: /home/sylvest/include/functions.php Called from my_session_start() at line 152 in file /home/sylvest/include/basic_init.php Called from require(/home/sylvest/include/basic_init.php) at line 128 in file /home/sylvest/public_html/swchoir/edit_member.php [27-Feb-2020 17:39:43.818 GMT 0] on , L_TRACE No session is active at line 789 in file: /home/sylvest/include/functions.php Called from my_session_start() at line 152 in file /home/sylvest/include/basic_init.php Called from require(/home/sylvest/include/basic_init.php) at line 128 in file /home/sylvest/public_html/swchoir/edit_member.php [27-Feb-2020 17:39:43.819 GMT 0] on , L_TRACE Session ID 5ks74rcukqqbkjdhchiru310q3 is now active, RemoteIp = 90.251.34.221 at line 804 in file: /home/sylvest/include/functions.php Called from my_session_start() at line 152 in file /home/sylvest/include/basic_init.php Called from require(/home/sylvest/include/basic_init.php) at line 128 in file /home/sylvest/public_html/swchoir/edit_member.php [27-Feb-2020 17:39:43.819 GMT 0] on , L_TRACE Session ID = 5ks74rcukqqbkjdhchiru310q3, $_SESSION = [] at line 805 in file: /home/sylvest/include/functions.php Called from my_session_start() at line 152 in file /home/sylvest/include/basic_init.php Called from require(/home/sylvest/include/basic_init.php) at line 128 in file /home/sylvest/public_html/swchoir/edit_member.php In the first bolded section, you can see that session ID qdgs4obtlicrlcgnp6tc179e87 is active, and that there are all sorts of session variables set. In the second bolded session, session_status() returned PHP_SESSION_NONE, so when I called session_start() it created a new session 5ks74rcukqqbkjdhchiru310q3 and all my session variables have gone. What am I doing that is causing the session to be lost? How do I make sure that when I call session_start() it retrieves any previous session if there is one, and does not create a new one? Can I implement my own version of session_start() and thus see exactly what it is doing and put in logic to prevent this error? What exactly does session_start() do? Thank you - Rowan ,
  4. I'm trying to debug some rewrite rules, without much success currently. If I could see the log, showing what text was used to match conditions in Rewrite Cond and Rewrite Rule statements, and what the result was, I would be more likely to be able to find the error. I have tried enabling logging in the .htaccess file and it says "ErrorLog not allowed here". How do I enable rewrite logging on TCH? If I can't, how do I debug my rules? Thanks - Rowan
  5. In my web application, I am trying to execute the SQL query: SELECT b.BuildNum,c.MenuName FROM `Members$BuildClasses` AS mc JOIN BuildClasses AS c ON mc.BuildClassId = c.BuildClassId JOIN Builds AS b ON c.BuildClassId = b.BuildClassId WHERE mc.MemberId = " . $_SESSION['login_memberid'] . " AND b.Status > '0' AND mc.Status > '0' ORDER BY BuildNum by executing the statement: $result = mysqli_query($dbh, $sql); on line 444 in file: /home/sylvest/include/functions.php (where $sql is equal to the above string) When I do this I'm getting this error: [26-Feb-2019 12:40:23.516 GMT 0] on localhost, L_ERROR Failed to query database, \$result is False, SQL = {SELECT b.BuildNum,c.MenuName FROM `Members` AS mc JOIN BuildClasses AS c ON mc.BuildClassId = c.BuildClassId JOIN Builds AS b ON c.BuildClassId = b.BuildClassId WHERE mc.MemberId = 4 AND b.Status > '0' AND mc.Status > '0' ORDER BY BuildNum}, Errno: 1054 Error: Unknown column 'mc.BuildClassId' in 'on clause' at line 444 in file: /home/sylvest/include/functions.php Called from checked_query(SELECT b.BuildNum,c.MenuName FROM `Members` AS mc JOIN BuildClasses AS c ON mc.BuildClassId = c.BuildClassId JOIN Builds AS b ON c.BuildClassId = b.BuildClassId WHERE mc.MemberId = 4 AND b.Status > '0' AND mc.Status > '0' ORDER BY BuildNumbuilds that this user may access) at line 254 in file /home/sylvest/include/header.php Called from require(/home/sylvest/include/header.php) at line 65 in file /home/sylvest/public_html/swchoir/welcome.php From this it seems that MySQL is executing the query on the table `Members` instead of `Members$BuildClasses`, which is why it can't find the 'mc.BuildClassId' field. An earlier version of the code DID request the table `Members` but I changed it several days ago. Why is it still using the old version of the code? Is there any caching system in place for this type of code? If so, what exactly is cached, and where? How do I force it to update the cache? Or what other reason might there be for this error? Thanks - Rowan
  6. My site uses the function json_encode(). Previously I had my own php.ini file that included the line "extension = json.so". Everything used to work fine. But for a different reason I had to stop using my PHP.INI file and start using one generated by CPanel. Now I'm getting the error "Fatal error: Call to undefined function json_encode() in /home/sylvest/include/var_dump_ret.php on line 16". The CPanel generated INI file does not contain the line "extension = json.so" and I guess that this is why it's stopped working. So my question is, how either using CPanel or within my PHP code do I load the module JSON? Web searches say there should be a command Select PHP Version within CPanel that allows this to be done, but TCH's version doesn't seem to have this. I guess TCH did not include this in their configuration. So how do I add any modules that I need? Thanks - Rowan
  7. I have a requirement for my PHP pages sometimes to send files (e.g. images, CSS files, JS files, fonts) to the client. The normal way to do this seems to be to use the readfile() function, but I understand that this reads the whole file into memory and then sends it to the client, which will cause problems if it is a very large file. I understand that there is an Apache module mod_xsendfile which does a better job, but Support tell me that this is not available on my shared server. So my question is, what is the best/most efficient way of sending files to the client in PHP, without mod_xsendfile? Do I have to write a loop that reads the file a few K at a time and sends each chunk to the client before reading the next? If so, has anyone got this code already working that they would be happy to share with me, to save a bit of time? Thanks - Rowan
  8. Hi, I have an HTML form with a large number of inputs on it. Most of them are <select> elements each with 6 options. There are currently 1295 of these selects, plus a few other inputs, but the number is not constant, since the form is generated dynamically, and it depends on the number of rows and the number of columns for the currently selected period. In the $_POST array it seems that I am only receiving 1000 values, which means that some of the ones I need I am not receiving. I have tried changing the value of max_input_vars in /home/myaccount/public_html/php.ini from 1000 to 10000, but this does not seem to have improved anything. Do I have to do anything (e.g. restart the server) for it to read this file? Or is this the wrong way of changing this limit? Or do I need to reduce the number of inputs in some way (it's not easy to see a way to do this without a lot of Javascript, which I have been trying to avoid). Thanks - Rowan
  9. I have the following SQL being executed by a mysqli_query() statement in my PHP code: DROP TEMPORARY TABLE IF EXISTS tmptable; CREATE TEMPORARY TABLE tmptable SELECT * FROM Members WHERE MemberId = '105' AND Status > '0'; UPDATE tmptable SET RecordId = '', Status = '0', ChangedBy = '4', ChangedOn = '2017-05-21 19:03:39'; UPDATE Members SET Status = '0' WHERE MemberId = '105' AND Status > '0'; INSERT INTO Members SELECT * FROM tmptable; It is being rejected with the following error: Errno: 1064 Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CREATE TEMPORARY TABLE tmptable SELECT * FROM Members WHERE MemberId = '105' AND' at line 1 at line 952 in file: /home/sylvest/public_html/swchoir/edit_member.php If I put the same SQL into the SQL tab in phpMyAdmin, it works fine. What do I have to do to make this work in my PHP code? Thanks - Rowan
  10. I have a web page which under certain conditions forwards to another one using the statement: header($next_page); where $next_page == "Location: http://www.sylvesterbradley.org/swchoir/index.php?v=1493894983" This causes a 500 error. I am reasonably sure that I have sent no output at all (other than to a log file) before the header statement. In any case, on other occasions where I have done this I seem to get a warning, which in this case is not happening. I see nothing in any error_log files that I am aware of (that is /home/sylvest/error_log and /home/sylvest/pubic_html/swchoir/error_log) nor do I see anything relevant in the cPanel Errors list. What am I doing wrong? How can I debug what is happening? I have a log statement early in the redirected-to file (index.php) and this does not seem to be being triggered, so I don't think it is ever executing this file. Thanks - Rowan
  11. I am trying to use the PHP password hashing module in my code, but the following line: $hasher = new PasswordHash(8, false); is giving me the error: Fatal error: Class 'PasswordHash' not found in /home/myaccount/public_html/directory/edit_member.php on line 124 I am running PHP version 5.6.30. I thought that all versions from 5.5.0 onwards had this module? What do I have to do to enable me to use this? Thanks - Rowan
  12. Here's an error reported from last night's attempt to run my PHP file in a cron job: Failed loading /opt/cpanel/ea-php54/root/usr/lib64/php/modules/ioncube_loader_lin_5.4.so: /opt/cpanel/ea-php54/root/usr/lib64/php/modules/ioncube_loader_lin_5.4.so: undefined symbol: execute Zend Guard Loader requires Zend Engine API version 220100525. The Zend Engine API version 220131226 which is installed, is newer. Contact Zend Technologies at http://www.zend.com/ for a later version of Zend Guard Loader. Set-Cookie: PHPSESSID=p4nu293cl2kikl2tb7t7ooo4j6; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Content-type: text/html; charset=UTF-8 <br /> <b>Fatal error</b>: Class 'PasswordHash' not found in <b>/home/myaccount/include/do_email.php</b> on line <b>153</b><br /> Questions arising: Why am I getting the undefined symbol: execute error? This seems to be something to do with loading PHP, before it has ever tried to access my script. Why is the session cookie that it is sending set to Expires: Thu, 19 Nov 1981? Why has it failed to find PasswordHash? This file runs correctly when called as part of my website, so I think the problems must be to do with diffferences between the environment when run as a web page and when run as a cron job. Thanks - Rowan
  13. Well, it sort of helps. Thanks for providing this link. But I think my most straightforward answer is to remember to use Firefox or Chrome if I want to access the TCH forum. Of course I will usually forget this until I find that I can't paste :-(. Thanks - Rowan
  14. Bruce, Thanks for your reply. Why is it that I can't do an internal rewrite to a location above public_html? Here is an exerpt from http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule The Substitution of a rewrite rule is the string that replaces the original URL-path that was matched by Pattern. The Substitution may be a: file-system path Designates the location on the file-system of the resource to be delivered to the client. Substitutions are only treated as a file-system path when the rule is configured in server (virtualhost) context and the first component of the path in the substitution is exists in the file-system So I guess this is saying that what I'm trying to do won't work in an .htaccess file. But is there a way that I can make it work in my Virtual Host config file? Surely there cabn;t be any fundamental reason why I can;t redirect to a file system diretory above public_html? I can after all include any of these files, which is pretty close to the same thing? Thanks - Rowan
  15. I have found many discussions on the web around this topic. Some say that a rewrite rule assumes that the redirect path is a file system path if the first element of the path (/home in this case) exists at the root of the file system (which it obviously does in this case). Otherwise it assumes that it is relative to the Document Root. Other people imply that redirect to a file system path is not permitted for .htaccess files for security reasons, but that you can use an Alias as a work around. Is it in fact possible to write a RewriteRule that will work in an .htaccess file on a TCH server to redirect to a file system path? How exactly do I do this? If not, is it possible to use an Alias (which would presumably point to a file system path from a web URL)? If so, how do I do this? You may ask - why do I want to do this? The answer is that I prefer to keep all the files that I include or redirect to in non web accessible places, to minimise the chance that someone can deduce or guess the names of these files, and then download them, and see the inner workings of my web site, security system etc,. thus compromising my security. I find it difficult to believe given all the things that mod_rewrite can do, that it can't do this... Thanks - Rowan
×
×
  • Create New...