|
Agrikk posted:I am bashing my head in over this one. File permissions maybe?
|
# ? Jan 27, 2021 07:37 |
|
|
# ? Jun 3, 2024 23:54 |
|
Nope. Full control on all the Dlls. I even tried moving all of my enabled DLLs to a new folder path and all of them work except for the yaml one.
|
# ? Jan 27, 2021 08:22 |
|
are you running php 32 bit? also, 7.0 has been end of life for multiple years, move on to 8
|
# ? Jan 27, 2021 08:34 |
|
better yet, are you remembering to load the yaml.dll that is in the 7.0's zip files? (in addition to php_yaml.dll) see step 5 of https://stackoverflow.com/a/27379895 - this is no longer relevant with the newer versions of php_yaml but since you are on such an old version, this may be why; php_yaml wraps yaml.dll and yaml.dll needs to be available on the path Impotence fucked around with this message at 08:43 on Jan 27, 2021 |
# ? Jan 27, 2021 08:41 |
|
php on windows would happily load a extension build for the same version and type, on the right folder maybe you can execute php from the command line to see if it produce a more verbose information of the error? It don't says "wrong version", but can't find it there. is the pathname correct? I would do something like execute code:
just to make sure the path is exact and is correct, maybe theres a space somewhere, or a extra "." or whatever. ---- the nuke option is to download a different version of PHP, and his own dll's. going up one version or down one version. this is a dumb workaround but may work.
|
# ? Jan 27, 2021 13:34 |
|
Well drat. There's an hour of my life I won't get back. Turns out that Biowarfare posted:see step 5 of https://stackoverflow.com/a/27379895 - this is no longer relevant with the newer versions of php_yaml but since you are on such an old version, this may be why; php_yaml wraps yaml.dll and yaml.dll needs to be available on the path was the solution. I saw zillions of people saying "add yaml.dll to C:\wamp64\bin\php\phpX\" but I figured that since I was running PHP command line only and not WAMP I didn't need that step. Turns out a better step would be "put yaml.dll somewhere that PATH can see it". Thanks thread! FWIW: I'll be upgrading to 8 eventually, but I have so many different workloads running on 7 and I'm afraid that 8 will break things that I hesitate to pull the trigger.
|
# ? Jan 27, 2021 16:38 |
|
If you need help with upgrading to 8, this package can detect a number of PHP8 changes and flag conflicts with them. It doesn't detect everything yet but it's a good start.
|
# ? Jan 27, 2021 16:46 |
|
Agrikk posted:was the solution. I saw zillions of people saying "add yaml.dll to C:\wamp64\bin\php\phpX\" but I figured that since I was running PHP command line only and not WAMP I didn't need that step. Turns out a better step would be "put yaml.dll somewhere that PATH can see it". yeah, the thing is.. that instruction hasn't been necessary for like 3 or 4 years now, ever since they built it into the dll instead of just wrapping it, so if you were just grabbing the latest version like most people would, you would not have a yaml.dll and you would not have a readme that tells you to do anything with the yaml.dll fwiw: WAMP is pretty much just also installing PHP identically command line, just in one of their subfolders
|
# ? Jan 27, 2021 18:33 |
|
I apologize if this is not allowed, but I would like to pay someone to provide me with a standalone .php file I cold plop on any webserver that will: 1. Pull the subscriber count from mailchimp (I can provide the API key, list ID, server name, etc) 2. Return the result as JSON My brother in law bought my sister one of those custom counter things. https://www.smiirl.com/en/counter/category/custom It has built-in integrations for facebook or instagram, etc, but he wants it to show mailchimp newsletter subscriber count. The requirements for this are just to have a URL we can point it to that just responds with a JSON array with number:value This should be super simple, but I'm too stupid to get it working. Mailchimp has custom functions(?) to make things easier but I was hoping for just a standalone whatever.php file I could throw on a webserver somewhere. I tried to get it working with googling and cURL in PHP but I am dumb. If this could be achieved another way easy enough I'm open to other options as well. I have access to the website via SFTP but that's about it so something standalone would be best, I think. Portability is important to me. Again, sorry if this is not allowed. But if someone is interested they can PM me or whatever for more information. In the off chance I get like 5 people wanting to do it if you could give me a roundabout quote, how you would like paid (I have a corporate credit card so I'm guessing like paypal or something would be fine), and your turnaround time and that would help me. Thanks, goons.
|
# ? Jan 27, 2021 20:33 |
|
Follow up on my YAML stuff: How do I pull elements out of nested PHP (7.0.2) arrays and assign each item to a variable so I can shove the data into a database table? Given a yaml file like this: code:
I've managed to parse the file into an array using yaml_parse_file(<filename>) and have pulled the top level stuff and the second level "planet" information using lines like code:
|
# ? Jan 28, 2021 01:06 |
|
dreesemonkey posted:I apologize if this is not allowed, but I would like to pay someone to provide me with a standalone .php file I cold plop on any webserver Perhaps you could head into SA-Mart? There's tons of gig-work there so I imagine there's a PHP pro who'll do the work for a price.
|
# ? Jan 28, 2021 01:09 |
|
You're overthinking the whilescode:
|
# ? Jan 28, 2021 01:34 |
|
Biowarfare posted:You're overthinking the whiles Let me talk through your code to see if I understand it: your code searches the original YAML array for any key called 'planets' and one at a time dumps all subordinate data to an array called $planetData. Then it checks the new $planetData array for a key called 'moons' If it finds one, it dumps any subordinate data for that key into an array called $moonData At which point I can do all of my clever things to the $moonData array Is that right? (I'm phone posting so I'm trying to wrap my head around this before I sit back down to code again.)
|
# ? Jan 28, 2021 20:57 |
|
In the innermost loop, $moonData refers to a single moon. But at the same time, you can access the parent planet's data in $planetId or $planetData. So if you want to individually insert each moon and the planet it's associated to, you can do that from the innermost. It does not take a copy of the entirety of the YAML or all the planets at any point, it just loops through individual planets and then invidiaul moons. If you don't save the data in $planetData or $moonData before that loop iteration ends, it is gone. Impotence fucked around with this message at 22:59 on Jan 28, 2021 |
# ? Jan 28, 2021 22:01 |
|
I got it working and you are right: I was really overthinking it. Thanks for the help!
|
# ? Jan 29, 2021 16:08 |
|
Agrikk posted:Perhaps you could head into SA-Mart? There's tons of gig-work there so I imagine there's a PHP pro who'll do the work for a price. I did just that and someone got me sorted right out, thanks!
|
# ? Jan 29, 2021 17:57 |
|
hey this work code:
code:
|
# ? Feb 1, 2021 12:37 |
Having trouble resolving this error after upgrading to a newer version of PHP (7.3):code:
code:
Permissions to the font seems fine. I googled around and found others were having a similar issue and using absolute path fixed it, but I'm already using an absolute path. I also tried the GDFONTPATH thing mentioned on the php documentation for imagettftext. Tried sticking the ttf in the same folder as the php script and tried both relative & absolute path. Still can't figure out what the deal is. I've got this in my config: code:
|
|
# ? Feb 4, 2021 07:32 |
|
perhaps you can put your font in a central repository (like you tried), then interrogate php about all fonts he see. is possible that the font name is different than what you trough... (?) (?) (?) try with a different fontfile, to make sure is not a problem with the font file itself being broken/not compatible somehow you could try is_readable or other builtin, so PHP can tell you if he can really read the file. does GD have a OOP interface? I can imagine a OOP version of the method would offer alternatives check error.log in apache, perhaps theres a error message in there you missed. (I know this don't make sense, but you lose nothing looking)
|
# ? Feb 4, 2021 13:27 |
|
Just throwing things out there, did you change anything else about the deployment when you upgraded PHP?
|
# ? Feb 4, 2021 13:34 |
Thanks for the replies!Tei posted:perhaps you can put your font in a central repository (like you tried), then interrogate php about all fonts he see. How do I interrogate PHP to see what fonts are available to it? Might be on to something with the font name being different than what I thought. When I open the ttf file in Windows it shows the name as Myfont even though the filename is myfont.ttf I tried putting the ttf file in the same folder as the php script with: code:
Seems that GD doesn't have an OOP interface but I it looks like there's some third party libraries I could look at if I can't get this working. Was hoping to avoid touching this code since it's ancient and in maintenance only mode. For the error log, I'm using nginx & fpm, didn't see any extra details in the logs though. Pile Of Garbage posted:Just throwing things out there, did you change anything else about the deployment when you upgraded PHP? I ran into this issue while migrating old chef scripts to docker containers so there are quite a few changes overall with the setup, but the PHP version was really the only significant one I could point to for this one.
|
|
# ? Feb 5, 2021 02:46 |
|
and the trying a different font file? did you tried that if it works with a different font file, then is the font file, if it don't work with a different font file, it probably the code
|
# ? Feb 5, 2021 12:59 |
|
I am trying to find the highest value for a given combination of array keys. The array I have is thus: code:
I've been banging my head on this all day and can't come up with a working solution.
|
# ? Feb 9, 2021 22:20 |
|
some abomination similar tophp:<? $counter = []; foreach ($array as $obj) { $key = "{$obj['year']}_{$obj['month']}_{$obj['gender']}"; if (!array_key_exists($key, $counter)) { $counter[$key] = $obj; } else { if ((int) $counter[$key]['votes'] < (int) $obj['votes']) { $counter[$key] = $obj; } } } ?> explode('_', k value) < makes it so that first into the tie wins (eg: checking votes = 1, 3, 4, 1, 4 means the first 4 will win), change <= if last ... this is assuming you don't want to use a proper database for it (?) Impotence fucked around with this message at 22:54 on Feb 9, 2021 |
# ? Feb 9, 2021 22:45 |
|
Biowarfare posted:some abomination similar to I already asked on the SQL thread, and I thought I understood the answer, but don't! code:
|
# ? Feb 10, 2021 01:13 |
|
fletcher posted:I ran into this issue while migrating old chef scripts to docker containers so there are quite a few changes overall with the setup, but the PHP version was really the only significant one I could point to for this one. Wait so you moved PHP to Docker (FPM or otherwise)? If so is the TTF file/the folder with the TTF mounted in the container?
|
# ? Feb 10, 2021 14:04 |
Pile Of Garbage posted:Wait so you moved PHP to Docker (FPM or otherwise)? If so is the TTF file/the folder with the TTF mounted in the container? Yup, using php7.3-fpm. The ttf file is indeed mounted in the container. The ttf file itself is part of the code repository of the app being deployed to the container. I was able to confirm via {{is_readable}} that PHP can read the ttf file. Had to give up on this issue for now, hoping to circle back to it in a week or so when I can spend some more time on it I tried some other fonts and still had the same issue
|
|
# ? Feb 10, 2021 20:42 |
|
How can I pull all data from an API that is paginated to return 1000 records at a time? Give the following URL: https://esi.evetech.net/latest/markets/10000002/orders/?datasource=tranquility&order_type=all&page=1 a single request will pull down the first page of json records, each page containing 1000 records. I know that the response header looks like this: code:
Is it possible to retrieve the x-pages record from the response header to then loop over the original request to pull down all of the data? Or is there a more direct approach to getting all of the paginated data?
|
# ? Feb 21, 2021 21:19 |
|
composer require rmccue/requestsphp:<? $r = Requests::get($url); echo (int) $r->headers['x-pages']; ?>
|
# ? Feb 21, 2021 21:29 |
|
Gracias!
|
# ? Feb 21, 2021 22:05 |
|
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 |
|
It was not until I was seen remember the other JS page. You're string "nnnnnnnnnnnnnnnnnnnnnnnnunnnnnnnnnnnnuuunnnuxunnnn..." You must base64 decode it with the corrected URLness. php:<?php $f = 'eJyNkDkOQCEIRO_iVaw8h9RaTcLxVXBD85dpCI8Jm0sPgknQUvAGwUQaILJMtFitDyaavpBzZTGCNobGvDcs3D7tZ33Kvn3HXFnpdS6f_cwdqn4vc3_Z_Esa8YdcAXCwqZ8'; $f = str_replace(['_', '-'], ['/', '+'], $f); $f = base64_decode($f); echo zlib_decode($f); Impotence fucked around with this message at 09:28 on Mar 3, 2021 |
# ? Mar 3, 2021 09:20 |
|
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 |
|
it works fine, you don't have https, you need https, mandatory can't include http on https page you also need actual working https on the server Impotence fucked around with this message at 03:18 on Mar 4, 2021 |
# ? Mar 4, 2021 03:03 |
|
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 |
|
you may also be not escaping the / in base64 correctly?
|
# ? Mar 4, 2021 03:19 |
|
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 |
|
Good Sphere posted: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. 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
|
# ? Mar 4, 2021 07:02 |
|
|
# ? Jun 3, 2024 23:54 |
|
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 |