Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Pile Of Garbage
May 28, 2007



Agrikk posted:

I am bashing my head in over this one.

I am trying to install the php_yaml.dll extension on my windows server (Server 2019 Datacenter v1809) with PHP version 7.0.21 (Thread Safety: Enabled) and I am getting the following error when running php.exe from the command line:

"Warning: PHP Startup: Unable to load dynamic library 'c:\php\ext\php_yaml.dll' - The specified module could not be found."

I have other extensions in the exact same place (c:\php\ext) being accessed the same way (extension=<module>.dll) in c:\PHP\php.ini. I have tested the configuration settings in PHP.ini by renaming an active .dll file which immediately causes the same "Unable to load dynamic library" to show up, so I know the settings are pointing to the right places.

For some reason PHP can't see php_yaml.dll. I have tried php_yaml-2.0.4-7.0-nts-vc14-x64 and php_yaml-2.0.4-7.0-ts-vc14-x64 and php_yaml-2.0.4-7.1-ts-vc14-x64 and they all behave the same way. I even tried php_yaml-2.2.1-7.4-ts-vc15-x64 and got a different error about "the procedure entry point" couldn't be located, which I'm sure has to do with the wrong version of VC14 vs VC15, but at least I know that PHP is looking in the right place for the file.

So why cant PHP find php_yaml.dll?

File permissions maybe?

Adbot
ADBOT LOVES YOU

Agrikk
Oct 17, 2003

Take care with that! We have not fully ascertained its function, and the ticking is accelerating.
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. :argh:

Impotence
Nov 8, 2010
Lipstick Apathy
are you running php 32 bit?

also, 7.0 has been end of life for multiple years, move on to 8

Impotence
Nov 8, 2010
Lipstick Apathy
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

Tei
Feb 19, 2011

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:
notepad  c:/whatever/something.dll  
with the path copied from the error message.

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.

Agrikk
Oct 17, 2003

Take care with that! We have not fully ascertained its function, and the ticking is accelerating.
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.

duz
Jul 11, 2005

Come on Ilhan, lets go bag us a shitpost


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.

Impotence
Nov 8, 2010
Lipstick Apathy

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".

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.

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

dreesemonkey
May 14, 2008
Pillbug
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.

Agrikk
Oct 17, 2003

Take care with that! We have not fully ascertained its function, and the ticking is accelerating.
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:
planets:
    40269113:
        celestialIndex: 1
        moons:
            40269114:
                planetAttributes:
                    heightMap1: 3903
                    heightMap2: 3908
                    population: false
                position:
                - -5515163578.0
                - 545177525.0
                - -43874418923.0
            40269115:
                planetAttributes:
                    heightMap1: 3988
                    heightMap2: 3567
                    population: false
                position:
                - -6615163578.0
                - 566177525.0
                - -66874418923.0
        planetAttributes:
            heightMap1: 3842
            heightMap2: 3903
            population: false
        position:
        - -5484995705.0
        - 542195411.0
        - -43853083014.0
    40269116:
        celestialIndex: 2
        moons:
            40269117:
                planetAttributes:
                    heightMap1: 3303
                    heightMap2: 3108
                    population: false
                position:
                - -5515162348.0
                - 545177234.0
                - -43234418923.0
        planetAttributes:
            heightMap1: 3855
            heightMap2: 3955
            population: false
        position:
        - -5484999705.0
        - 542199991.0
        - -43859993014.0
    40269118:
        celestialIndex: 3
        planetAttributes:
            heightMap1: 3246
            heightMap2: 6542
            population: false
        position:
        - -3657999705.0
        - 548765991.0
        - -43859987614.0
radius: 1467665281408.0
regional: true
security: 0.9531232305867214
securityClass: A
solarSystemID: 30000144
solarSystemNameID: 269101
In which a planet can have 0+ moons, how do I parse this information in PHP so that I can dump it into a MSSQL database?

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:
while($element = current($yaml["planets"])) {
	echo "celestialIndex: ".$yaml["planets"][key($yaml["planets"])]["celestialIndex"]."\n";
	echo "heightMap1: ".$yaml["planets"][key($yaml["planets"])]["planetAttributes"]["heightMap1"]."\n";
	echo "heightMap2: ".$yaml["planets"][key($yaml["planets"])]["planetAttributes"]["heightMap2"]."\n";
	echo "population: ".$yaml["planets"][key($yaml["planets"])]["planetAttributes"]["population"]."\n";
}
but I can't figure out how to perform a while loop inside of a while loop to capture multiple "moon" arrays like I did with the "planets" arrays. I had thought I could just use multiple key entries in nested while loops, but that's not working.

Agrikk
Oct 17, 2003

Take care with that! We have not fully ascertained its function, and the ticking is accelerating.

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.

Impotence
Nov 8, 2010
Lipstick Apathy
You're overthinking the whiles

code:
$f = yaml_parse_file('test.yaml');
foreach ($f['planets'] as $planetId => $planetData) {
        if (array_key_exists('moons', $planetData)) {
                foreach ($planetData['moons'] as $moonId => $moonData) {
                        echo "moon attached to planet={$planetId}: moon={$moonId} - " . json_encode($moonData) . PHP_EOL;
                }
        }
}

Agrikk
Oct 17, 2003

Take care with that! We have not fully ascertained its function, and the ticking is accelerating.

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.)

Impotence
Nov 8, 2010
Lipstick Apathy
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

Agrikk
Oct 17, 2003

Take care with that! We have not fully ascertained its function, and the ticking is accelerating.
I got it working and you are right: I was really overthinking it.

Thanks for the help!

dreesemonkey
May 14, 2008
Pillbug

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!

Tei
Feb 19, 2011

hey

this work
code:
$a = new stdClass;
$b = new $a;
$c = new $b;
$d = new $c;
this don't work

code:
$d = new new new new stdClass;

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
Having trouble resolving this error after upgrading to a newer version of PHP (7.3):
code:
Warning: imagettftext(): Could not find/open font
The code is just:
code:
$font = "/absolute/path/to/my/fonts/myfont.ttf"
imagettftext($image, 10, 0, $x, $y+15, $black, $font, 'Some '.$thing);
I've got the php7.3-gd package installed (OS is Debian 10) and phpinfo seems fine for gd & freetype:


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:
ini_set("display_errors","1");
ini_set("display_startup_errors","1");
error_reporting (E_ALL);
Not seeing any errors anywhere that would have more details as to what's going on though.

Tei
Feb 19, 2011

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)

Pile Of Garbage
May 28, 2007



Just throwing things out there, did you change anything else about the deployment when you upgraded PHP?

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
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.

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)

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:
echo is_readable('myfont.ttf');
putenv('GDFONTPATH=' . realpath('.'));
$font = 'Myfont'; // also tried myfont.ttf
is_readable returns true but still not working

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.

Tei
Feb 19, 2011

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

ModeSix
Mar 14, 2009

I am trying to find the highest value for a given combination of array keys.

The array I have is thus:

code:
Array
(
    [0] => Array
        (
            [year] => 21
            [month] => 1
            [gender] => 1
            [votes] => 2
            [user_id] => 1
            [username] => testuser123
        )

    [1] => Array
        (
            [year] => 21
            [month] => 1
            [gender] => 2
            [votes] => 13
            [user_id] => 2
            [username] => prettygirl
        )

    [2] => Array
        (
            [year] => 21
            [month] => 1
            [gender] => 2
            [votes] => 1
            [user_id] => 4
            [username] => allenalb
        )

    [3] => Array
        (
            [year] => 20
            [month] => 12
            [gender] => 1
            [votes] => 1
            [user_id] => 1
            [username] => testuser123
        )

    [4] => Array
        (
            [year] => 20
            [month] => 12
            [gender] => 2
            [votes] => 2
            [user_id] => 2
            [username] => prettygirl
        )
     [5] => Array
        (
            [year] => 20
            [month] => 12
            [gender] => 2
            [votes] => 7
            [user_id] => 55
            [username] => anotheruser
        )

     [6] => Array
        (
            [year] => 20
            [month] => 12
            [gender] => 2
            [votes] => 3
            [user_id] => 31
            [username] => anotheruser22
        )

)
I want to figure out which user received the most votes for a given year, month, gender, combination. Ignoring ties, how can I extract the highest vote count for each year/month/gender combo? A new result set will be generated each month.

I've been banging my head on this all day and can't come up with a working solution.

Impotence
Nov 8, 2010
Lipstick Apathy
some abomination similar to

php:
<?
$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; }
    }
}
?>
$counter will be k-v, k of year/month/gender and v of the winning object
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

ModeSix
Mar 14, 2009

Biowarfare posted:

some abomination similar to

php:
<?
$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; }
    }
}
?>
$counter will be k-v, k of year/month/gender and v of the winning object
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 (?)
I'm actually pulling this from a MySQL database using the below query, if you know how to make it only deliver the highest value for each year/month/gender combination that would solve this. I don't know enough advanced SQL to make it do it on the database, though I know that's a better solution.

I already asked on the SQL thread, and I thought I understood the answer, but don't!

code:
SELECT be.year, 
       be.month, 
       be.gender, 
       COUNT(bv.votefor_id) as votes, 
       be.user_id, 
       u.username, 
       be.image 
FROM   datingsite_beauty_entries be 
       INNER JOIN datingsite_beauty_votes bv 
               ON be.user_id = bv.votefor_id 
       INNER JOIN datingsite_users u 
               ON be.user_id = u.id 
WHERE  be.year = bv.year 
       AND be.month = bv.month 
GROUP  BY bv.votefor_id, 
          be.year, 
          be.month 
ORDER  BY year DESC, 
          month DESC, 
          gender ASC, 
          votes DESC 

Pile Of Garbage
May 28, 2007



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?

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

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

Agrikk
Oct 17, 2003

Take care with that! We have not fully ascertained its function, and the ticking is accelerating.
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:
 access-control-allow-credentials: true 
 access-control-allow-headers: Content-Type,Authorization,If-None-Match,X-User-Agent 
 access-control-allow-methods: GET,HEAD,OPTIONS 
 access-control-allow-origin: * 
 access-control-expose-headers: Content-Type,Warning,ETag,X-Pages,X-ESI-Error-Limit-Remain,X-ESI-Error-Limit-Reset 
 access-control-max-age: 600 
 allow: GET,HEAD,OPTIONS 
 cache-control: public 
 content-encoding: gzip 
 content-type: application/json; charset=UTF-8 
 date: Sun, 21 Feb 2021 20:05:26 GMT 
 etag: "0a64ba7f894308739e51b1f4793cac9e79662ec9004fefc7d87a6a01" 
 expires: Sun, 21 Feb 2021 20:09:33 GMT 
 last-modified: Sun, 21 Feb 2021 20:04:33 GMT 
 strict-transport-security: max-age=31536000 
 vary: Accept-Encoding 
 x-esi-error-limit-remain: 100 
 x-esi-error-limit-reset: 34 
 x-esi-request-id: db4386e1-6967-40e2-bac5-6a94bfd48db9 
 x-pages: 321
which includes the number of pages to download.

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?

Impotence
Nov 8, 2010
Lipstick Apathy
composer require rmccue/requests
php:
<?
$r = Requests::get($url);
echo (int) $r->headers['x-pages'];
?>

Agrikk
Oct 17, 2003

Take care with that! We have not fully ascertained its function, and the ticking is accelerating.
Gracias!

Good Sphere
Jun 16, 2018

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:
eJyNkDkOQCEIRO_iVaw8h9RaTcLxVXBD85dpCI8Jm0sPgknQUvAGwUQaILJMtFitDyaavpBzZTGCNobGvDcs3D7tZ33Kvn3HXFnpdS6f_cwdqn4vc3_Z_Esa8YdcAXCwqZ8
Since Pako is zlib, I thought I would need to use zlib_decode in PHP, but I get no inflated value, or at least I don't know how to see it as a normal string which I need.

code:
$inflated = zlib_decode($stringToInflate);
echo "stringToInflate = ".$stringToInflate."<br>"; // string value mentioned above
echo "inflated = ".$inflated."<br>"; // nothing

Impotence
Nov 8, 2010
Lipstick Apathy
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);

You used JSON.stringify presumably too, so if you want to remove the double quotes from the string that you encoded in, $output = json_decode(zlib_decode(base64_decode(str_replace(['_', '-'], ['/','+'], $f))));

Impotence fucked around with this message at 09:28 on Mar 3, 2021

Good Sphere
Jun 16, 2018

Biowarfare posted:

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);

You used JSON.stringify presumably too, so if you want to remove the double quotes from the string that you encoded in, $output = json_decode(zlib_decode(base64_decode(str_replace(['_', '-'], ['/','+'], $f))));

Thank you! That did the trick.

Good Sphere
Jun 16, 2018

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:
[img]http://majoroutput.com/eJyNkDkOQCEIRO_iVaw8h9RaTcLxVXBD85dpCI8Jm0sPgknQUvAGwUQaILJMtFi/tDyaavpBzZTGCNobGvDcs3D7tZ33Kvn3HXFnpdS6f_cwdqn4vc3_Z_Esa8YdcAX/CwqZ8=@16.png[/img]
url of image:
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

Impotence
Nov 8, 2010
Lipstick Apathy
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

Good Sphere
Jun 16, 2018

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

Impotence
Nov 8, 2010
Lipstick Apathy
you may also be not escaping the / in base64 correctly?

Good Sphere
Jun 16, 2018

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.

Impotence
Nov 8, 2010
Lipstick Apathy

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

Adbot
ADBOT LOVES YOU

Good Sphere
Jun 16, 2018

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.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply