Jump to content

requinix

Administrators
  • Posts

    15,227
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. It would be the same error message if it returned true, that's right. But the function does not return true. It only ever returns a resource or false. There is a problem and neither of us knows exactly what it is just yet. This unknown problem is causing ssh2_exec to return false. If you can find out what the problem is and fix it, then your code will get the resource it expects and everything should work. To try to find out what the problem is, my question was: is there anything else that has changed with your system, or perhaps the system you are trying to SSH into, besides the fact that you are using PHP 8 instead of PHP 7? Any other configuration changes? Could it be that you are using PHP 8 not because the server upgraded but because you're using a whole new server entirely?
  2. Wrong question. What you should be asking is "why is $stream a boolean and not a resource?" It is because ssh2_exec returned a boolean - false, specifically. So why is it returning false? The documentation says it will return false "on failure". Not especially helpful, but at the very least it means there was a failure in trying to run your command. Do you have any idea what it might be? Any messages in your error log? Anything changed besides literally the fact that you are using PHP 8 instead of 7?
  3. Normally the "permission denied" is your major clue as to the problem, but in this case it's a little misleading... Take a close look at the path that require_once is trying to load.
  4. The correct syntax is demonstrated in the link I gave.
  5. Then the issue here may just be your syntax: return view('products.create', [ $result = (new CategoryController)->Category() ]); Compare that with how the online docs use the view() function.
  6. Question: why choose PHP for network programming? It's like choosing a hammer to peel a banana...
  7. What is this, Laravel? Get the list of categories in your controller and pass them to your view. Try writing the code for that and we'll see how it goes.
  8. I don't see how "my spreadsheet has a checkbox" and "PHP is web-based" are related... The only other thing I can think of is highly specialized: if PHP is running on a Windows machine that has Office installed then you can probably make use of COM. If that's the case then the first step towards using that would be writing VBA that does everything you need to do instead of PhpSpreadsheet.
  9. To prevent accidental repeated submissions of the form. Look around the internet and you'll see this "disable on click" paradigm everywhere.
  10. Can we assume that the button is located within the form? What's your full code right now?
  11. I believe that's what kicken was trying to say.
  12. You don't, and whoever created that WSDL was dumb to not consider potential situations like this. You can, however, use the magic __call method to intercept calls to methods that don't exist, and create a properly-named method to do the work. class MySoapServerClass { public function __call(string $method, array $args) { return match ($method) { "ProvideDocument-b" => $this->ProvideDocumentB(...$args), }; } private function ProvideDocumentB(...) { ... } }
  13. There is no alternative to AJAX. You don't have to use jQuery for it in this age of fetch(), but IMO it's great for the kinds of DOM manipulation you'll be doing anyway. First step: using your browser's developer tools, can you confirm that the AJAX request is sending the necessary data, to the right place, and receiving the necessary data in return?
  14. post_max_size is not part of the file upload system, so if the request is too large then $_FILES will not tell you - because the upload wasn't tried. You should be able to detect if the request was too large by looking at the Content-Length request header. If there is one, since it's possible the request won't use that. Without, you may be able to filesize the request body, which is accessible at php://input. Maybe. Otherwise the solution is simple: make sure post_max_size is always greater than upload_max_filesize. That way you'll always get an error if it's too large.
  15. Got multiple problems here, not the least of which is: I don't see where you actually output your $navigation.
  16. Obvious question: why isn't the first query returning what you want, instead of you faking the data yourself? Second question: How did you, as a human being, decide what to do with $array2 to get that merged version? Because I can't see how [ID=1,NumberOfTickets=21] [ID=2,NumberOfTickets=12] translates into [name=NumOfTickets,table=DatabaseModelTable].
  17. So with this, <a href="<?php print wp_kses_post($item['linkedin']); ?>"><i class="fab fa-linkedin-in"></i></a> the link is wp_kses_post(...) and you don't want to show the <a> if the link is empty. Get the value of the link into a variable, use it with the if statement, then only show the <a> if not empty. <?php $linkedinlink = wp_kses_post($item['linkedin']); if ($linkedinlink) { printf('<a href="%s"><i class="fab fa-linkedin-in"></i></a>', htmlspecialchars($linkedinlink)); } ?> Remember to use htmlspecialchars when you do not know if a value is 100% safe for HTML.
  18. Try adding back the @s that you had before.
  19. Don't know what an "elementor" is... You have decided that you need an if/else to solve a problem. What is the problem itself? What field, and why do you need to know if it's empty?
  20. java.com is Oracle. The open-source community made their own - at least two, even, but OpenJDK is the frontrunner.
  21. Homebrew invented their own terminology for things that everyone else had communally decided on. So that doesn't help. Plus, Java isn't just "Java" since Oracle took over, so there is no simple "java" to install anymore either. Assuming you want the JDK (for development) and not just the JRE (which isn't a thing either, technically, but it's the minimum needed to run Java programs), the "formula" you want is openjdk. https://formulae.brew.sh/formula/openjdk Java 8, aka 1.8, is the oldest anyone cares about, by the way.
  22. Short answer is there's probably no reasonable way. Upload the text file to a temporary location and then move it where you want. That way there's no partial file.
  23. They're the same thing. "master" and "HEAD" are both git terms, and the full explanation is too long, so suffice it to say that they'll both refer you to the most recent version of install.sh.
×
×
  • 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.