Jump to content

requinix

Administrators
  • Posts

    15,227
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. Which binaries do you expect? The ones for Apache support? The FPM daemon? FastCGI? Just the CLI? Debian/Ubuntu separate PHP into multiple subpackages. "php5.6" is a metapackage with only a handful of files itself. You typically install the more specific packages in addition/instead. nginx and php-fpm are separate. You install and configure both individually. Apache and mod_php are not separate because that approach has PHP as an Apache module so they're directly related. It's the traditional configuration, and one that's mostly fallen out of favor.
  2. Wow, it's so old it claims to be compatible with PHP 6. If you're starting from PHP 5.x then you're probably around 5.3 or 5.4. Going to 5.6 as the next step is good and probably won't be too bad. Going to 7.4 is a significant leap that you may want to split into 7.0 first and then 7.4 after. Because breaking the upgrade process down into steps like that helps make it manageable - going from 5.x directly to 7.4 could easily be a tough slog that will take a long time without the end in sight. I assume there's more than just installing the most recent version of phpBB? Which is apparently still in active development?
  3. The query is going to be very much invalid and thus won't run. You've also got PHP syntax errors, and if you're seeing a white page then you don't have error logging and/or displaying set up. Use prepared statements.
  4. Do you actually have both php5.6-fpm and php7.4-fpm available to install?
  5. I don't follow: you're talking about /usr/bin/php but the error message is talking about google-chrome. If you're running things in the browser then the path to PHP doesn't matter. Unless you want to use its development server, but I don't think that's the case. So what's the problem here?
  6. We aren't sitting at your computer watching you work. We have no idea what it's doing or what you expect it to be doing. Saying it "doesn't work" is helpful to you but doesn't mean anything to us. What is "not working"?
  7. https://3v4l.org/ddIcd Is your $variable using UTF-8 encoding?
  8. Any errors in the browser console? Can you see in the developer console the browser making a network request to shipline.php?
  9. You made it more complicated than it needs to be: /[A-Z]/
  10. Single sign-on means one place that you use to log in. It does not necessarily mean that you use it to sign in once and then nothing has to ask for your account again. In fact it shouldn't: the place with your account should be asking you each time whether you want to allow $app access to your account. If you coded the account stuff yourself and you're being asked multiple times then it means your app is not remembering you. If you wanted, you could have it remember you (like with a cookie) so that next time all you'd need to do is click a button to allow access. One way or another, you really should make sure that you have to click a button or do something - don't make the authentication completely automatic when a different app wants you to sign in. For example, in addition to remembering you, your site can also remember which apps you've allowed access to: if the same app wants access then that could be automatic, but if a different app wants access then your site should tell you first.
  11. That's not headers. You have something in place that is preventing the request, and you're the only one who would be able to find out what it is. Check your server or PHP logs for a hint. In the meantime, 1. Why use POST if you're not sending anything? Use GET. 2. XMLHttpRequest is so last decade. Use fetch.
  12. If you're not sure what you're doing then don't install Apache manually by yourself. Use WampServer or XAMPP instead: they have Apache and PHP and MySQL included and (mostly) set up already.
  13. I can't tell what you're describing. Screenshot? Is this viewable on the internet right now?
  14. Impossible to know from just the code that you posted. It depends how get_robots_data is used. To be clear, here. You're talking about making /robots.txt itself noindexed, right?
  15. https://betterprogramming.pub/how-not-to-ask-questions-on-the-internet-72dd30e273a7
  16. file_get_contents is probably the right solution. What was the code you had that tried to use it, what happened when you ran it, and what did you expect to happen?
  17. It's one of those things that isn't harmful per se - it's redundant, really - but if someone wrote it then they could be making a mistake in some other sort of way.
  18. private + final doesn't make sense: if it's private then nothing can override it anyway. Just make it private.
  19. Hmm, looks like you'll need a modification or two to the array I suggested. More like array( 13763 => array( "base_image" => "13763.jpg", "additional_images" => array( "13763-1.jpg", "13763-2.jpg" ) ), 0. Start with an empty array for you to store the lists of additional files you'll be building. 1. Use glob() to get the list of files. It already comes sorted in ascending order, you need it sorted in ascending order, and I'm not sure why you want to sort it in reverse order. 2. Use pathinfo() to get the different parts of the file name. Look at the different parts it returns because you'll want more than one of them. 3. If the filename-without-extension portion is just a number then add an entry to the array. You know the base_image value already. Start with the additional_images empty. 4a. If the filename-without-extension portion is not just a number then split it into (1) the initial number and (2) the hyphen and everything after it. 4b. Look for an entry in the array for the number. If it exists then add the file to the additional_images array. If not then I don't know what you want to do. At the end of this, you should have an array that looks like the sample above...
  20. I think I'm getting an aneurysm. What you're describing does not seem to match what the screenshot of the file shows. I think what you actually want to do is (1) find all the files in the directory, (2) group them by the initial number in the name, then (3) sync up the CSV file according to the new set of files. But what to do with files in the CSV that aren't in the directory? Seems you want to discard them? So one step at a time. You need to get an array - one that is not $additionalImages but something entirely different - which has a list of all the files grouped by that initial number. With your example, it will look like array( "13763.jpg" => array( "13763-1.jpg", "13763-2.jpg" ), "13764.jpg" => array( "13764-1.jpg", "13764-2.jpg" ), "13765.jpg" => array() ) That means there is a 13763.jpg with two additional files, 13764.jpg with two more additional files, and 13765.jpg without any additional files. Once you have that then you can move onto the next step of writing it to the file...
  21. Use $_GET or $_POST to get a value from the form. If you're being tested on being able to do things like use cURL for API requests then I assume that handling form data was covered in earlier lessons.
  22. Correct. Consider how you'll be using this table and how often. When will you need to read it? When will you need to write to it? Writing is infrequent: when a user views a thread. Humans don't do that at any kind of speed a computer might consider "fast". Open a few tabs at a couple per second, then stop while they read. That's nothing. But reading, that's a lot more frequent. You'll need it for thread listings (what's read and what isn't), probably for thread viewing (mark where "new" content starts), perhaps for daily tasks. Still not exactly a large volume, but the point is it's much more frequent than reading. So the conclusion? Go ahead and sacrifice some write performance if it gains you read performance. I'm thinking CREATE TABLE whatever ( id bigint unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY, user_id bigint unsigned NOT NULL, thread_id bigint unsigned NOT NULL, last_read DATETIME NOT NULL, UNIQUE (user_id, thread_id) ) ENGINE=MyISAM;
  23. It'll be a lot more useful if you can track not just whether they've read the thread but whether there have been any new posts since then. Because if I read a thread and someone adds to it later, now I haven't read the thread anymore. Grow long? Yes. Grow relatively fast? Yes. Be a problem? No. Database systems are designed for this sort of thing, and with good design on your part (especially indexes) a large table won't be any problem at all. At least not for mortals like you and me - grow to Facebook scale and we'll have to revisit this. You can also consider a "mark all as read" feature that will help here. You store a timestamp with the user, that applies to either the entire site or to just one subforum, that tracks the last time they hit the "mark all as read". Checking if a thread has been unread or not is a two-step process of checking (1) whether the most recent timestamp for it is after the mark-as-read timestamp then (2) the thread's most recent post is not recorded in the has-previously-read table. Which means that if/when the user hits the button you can also zero-out their records in the read table.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.