|
My work is having me start in on something on the web that is real time, amongst many users. This could be a chat or a game. I'm only starting to become familiar with this kind of development, so I first looked into Ratchet since I know a bit about PHP. I foolishly installed it onto our shared hosting. I learned a lot; including installing and messing with stuff in bash. But it doesn't allow websockets or listening ports. Is Ratchet still in use? Any information on popular services that use it? Should I be using Symfony instead? What should I be using? What should I be using as a VPS just to get started?
|
# ¿ Apr 10, 2020 19:59 |
|
|
# ¿ May 21, 2024 00:13 |
|
Thanks for the suggestions. They got Kamatera Ubuntu server with nginx. I logged into Kamatera's dashboard for the account, and ssh'd in Mac OS's Terminal. I don't know where to even start. I'm so used to using an ftp client and the like, and I don't even know how with this yet, or if I should. A new frontier for me.
|
# ¿ Apr 14, 2020 18:52 |
|
Pile Of Garbage posted:If you can SSH you can usually SFTP. Just connect with your FTP client of choice on port 22. Oh duh I wasn't using the right username. Thank you!
|
# ¿ Apr 14, 2020 19:39 |
|
I made a compressed string with Pako (zlib) in JS. I'm trying to decode it in PHP, but I get nothing if I echo it back. The string that was encoded in js is: code:
code:
|
# ¿ Mar 3, 2021 04:54 |
|
Biowarfare posted:It was not until I was seen remember the other JS page. Thank you! That did the trick.
|
# ¿ Mar 3, 2021 17:44 |
|
Does anyone know why my image won't display using the img tag from my site? The image is generated by a php script. Below is the image tag: Since the tag and image code can't be seen unless quoted, it is: code:
http://majoroutput.com/eJyNkDkOQCEI...X/CwqZ8=@16.png My server is setup with htaccess to run a php script to create an image out of the URL with imagepng and making the header Content-Type: image/png. Works fine from my site or another domain of mine. Both domains are the same hosting, but should that even matter? Are there any htaccess or php settings I should tweak? Good Sphere fucked around with this message at 03:01 on Mar 4, 2021 |
# ¿ Mar 4, 2021 02:52 |
|
Weird it works from my phone, but not my desktop. So I need https? But it works fine.. on my phone but not on my desktop. That will fix it? e: I think I get it. The SA app may be using http instead of https somehow. Good Sphere fucked around with this message at 03:16 on Mar 4, 2021 |
# ¿ Mar 4, 2021 03:07 |
|
Biowarfare posted:you may also be not escaping the / in base64 correctly? It works with https like you said. Site was approved for an SSL certificate in literally 2 minutes lol. Thanks again for all your extremely helpful input.
|
# ¿ Mar 4, 2021 03:28 |
|
Biowarfare posted:yes congrats! the tl;dr is that by default all modern browsers will not let you include http content on a https page, because a single http-element downgrades the entire page to insecure/potentially compromised Yup, totally makes sense. It’s been a while since I had to deal with that, so I didn’t think of that being the problem.
|
# ¿ Mar 5, 2021 20:29 |
|
I'm trying to get php installed on macOS, using Intel processor. I've had it before, but I understand there has been some changes, and the brew install is your best bet. Seems to be installed, although php is showing the script instead of the rendered page in my browser. I'm using localhost in the address bar. I followed these instructions: https://github.com/shivammathur/homebrew-php
|
# ¿ Jan 15, 2022 22:56 |
|
ModeSix posted:Your best and easiest bet might be XAMPP: https://www.apachefriends.org/download.html Thanks! I was just looking into MAMPP, but now I have XAMPP installed and running, with my files. One thing that got me was the php short tags. I turned it on, but regardless it just won't work. I know it's not safe because of the bad interactions it can have with xml. No big deal, I can write "<?php". Good Sphere fucked around with this message at 01:34 on Jan 16, 2022 |
# ¿ Jan 16, 2022 01:01 |
|
An older workplace contacted me that made me aware of a download abuse issue with php Content-Disposition: attachment and readfile. It seems that my problem is with readfile, because although this script works, whether or not the client closes their browser, readfile reads the entire contents of the mp4, setting up the possibility of abuse with scripts initiating the download and immediately closing the progress. Something, somewhere, is running a script which clicks this link hundreds of times per second, running my php script and immediately cancelling their download, but my server is preparing that entire file to be offloaded each time. Here's the script I'm running, when the user/abuser clicks a download link: code:
|
# ¿ Apr 21, 2022 17:48 |
|
Thanks a lot for the suggestions. I worked on this over a decade ago, and there were some other sketchy things going on. Like, the user could send whatever address they wanted, even the server configuration if they knew what it was. This is what I have now. How does it look?code:
|
# ¿ Apr 23, 2022 20:58 |
|
nielsm posted:Not better at all. Thanks... This is a former boss contacting me asking me if I can fix it. Guess not! I have not done this stuff in a really long time. My impression was that unless I have ignore_user_abort(true), PHP should see that connection was aborted and discontinue executing this download; at least modern versions of PHP, which I know this was updated to 7.4.29. And I thought readfile() was the exception to that. Those seem like all good suggestions, but kind of out of the scope for a quick fix from me, unless they want to pay $$$. It's really good to know though, so thank you. That last bit you mentioned in your edit just makes me want to serve these videos on the same hosting. I have no idea why they have a separate download subdomain with other hosting. This should have plenty of space to host it.
|
# ¿ Apr 24, 2022 00:18 |
|
Does anyone know the reasoning behind losing an install of XAMPP VM, along with all the files you put in htdocs? edit: I reinstalled XAMPP VM, and the files are back! I wonder how they were stored in the first place. A search did not find it initially. Good Sphere fucked around with this message at 16:27 on Jun 4, 2022 |
# ¿ Jun 4, 2022 16:11 |
|
Running macOS 12.1, with Xammp running, so that I can run php locally. Can I open a file with its default application with shell_exec? edit: This works in Terminal: open -a "myAppName" file.txt This does nothing in php: code:
Good Sphere fucked around with this message at 20:45 on Jul 7, 2022 |
# ¿ Jul 7, 2022 20:02 |
|
|
# ¿ May 21, 2024 00:13 |
|
musclecoder posted:The shell_exec() method returns the output of the command, so you could see what is being output: Thanks for the info. I tried your suggestions. Used echo(shell_exec("open -a 'myAppName' file.txt"));, also with full path, and even without specifying the app name. Maybe it's how things are configured on the php end. Since you're curious, here's a some background to why I want to do this. I have javascript that calls a certain numbered function that renders graphics frame by frame. Those images get saved with an ajax call to php. I string the images into a video using ffmpeg via command. First, it would be nice to be able to start making that video right away when the images are all rendered with that ffmpeg command. That's not too much of a problem though. The real reason is that I want an interface where I can make new files; one for each image generation function. These functions are kind of containers for little programs that make these animation frames. So if I want to edit one, I could just click in a list and hit open. There's more to it than that too. They are just function names with arbitrary numbers. I could keep it that way, but in a sql database, I could have different things like titles for the functions (which I could change later without having the program affected), and descriptions. Good Sphere fucked around with this message at 01:56 on Jul 8, 2022 |
# ¿ Jul 8, 2022 01:38 |