Jump to content

[Solved] small issues with Tommy PHP????


thexkey
 Share

Recommended Posts

hi again, hopefully im not driving you insane:

i am having some issues with the header() function on Tommy where setting it anything outside of image stuff will cause random errors or the code to stop running.

i know it is not my code since it runs perfectly fine in XAMPP

 

also,  why do the fourm signatures only allow HTTPS image urls? my HTTPS cert expired when cPanel was revoked.

Link to comment
Share on other sites

No idea on the header issue, my apps are still working fine...do you have an example of code that doesn't work?

As for the secure images, there's a setting for that and it's intentional. The reason is because if you allow insecure images, modern browsers will whine about those insecurely-loaded images or refuse to load them when they're embedded in a website whose page is loaded over SSL. By forcing you to use https URLs for images, it becomes impossible for these to ever appear because they simply cannot be posted.

Link to comment
Share on other sites

3 hours ago, wolstech said:

No idea on the header issue, my apps are still working fine...do you have an example of code that doesn't work?

As for the secure images, there's a setting for that and it's intentional. The reason is because if you allow insecure images, modern browsers will whine about those insecurely-loaded images or refuse to load them when they're embedded in a website whose page is loaded over SSL. By forcing you to use https URLs for images, it becomes impossible for these to ever appear because they simply cannot be posted.

Sure, here are some header() codes i try to use that might not work:

header('Location: https://steamcommunity.com/');
header('Content-Type: application/json; charset=utf-8');

however, these header() codes work fine:

Header('Content-Type: image/png');
Header('Content-Type: image/jpeg');

Also, is it possible to renew my SSL certs and if so how?

Link to comment
Share on other sites

If you generate a certificate with something like zerossl, you can upload it to your home folder (not public html!) and post here asking for Krydos to install it. Make sure to upload both the certificate and the key.

I would have to play with the headers to see why they don't work. I use both of the ones you say don't work myself, and they're fine on my account.

Link to comment
Share on other sites

6 hours ago, thexkey said:

Sure, here are some header() codes i try to use that might not work:

header('Location: https://steamcommunity.com/');
header('Content-Type: application/json; charset=utf-8');

I just tested both of these on Tommy and they both work.

Link to comment
Share on other sites

The error is right there...

Warning: Cannot modify header information - headers already sent by (output started at /home/thexkey2/public_html/pootisnetwork.hypertv.heliohost.org/api/index.php:1) in /home/thexkey2/public_html/pootisnetwork.hypertv.heliohost.org/api/get_data.php on line 98

Your code is sending output or other headers before this. That error is a code issue, not a server issue.

The fact it says line 1 makes me bet you have either a blank line, HTML of some type, or a space before the <?php tag in index.php...

Link to comment
Share on other sites

1 hour ago, wolstech said:

or a space before the <?php tag in index.php

this is what i had, strange that it wouldn't be erroring on XAMPP but now that's fixed.

Link to comment
Share on other sites

  • Krydos changed the title to [Solved] small issues with Tommy PHP????

Not strange at all. Windows is much more forgiving than Linux when it comes to PHP development, so it's pretty common for code that works on Windows to not work on Linux unless designed that way.

The most common issue I see that manifests this way is file not found errors caused by case sensitivity (Windows file names and paths are not case sensitive, but Linux's are), but  then Windows also does a few other things differently...auto-trim (what bit you...Windows PHP trims leading/trailing spaces, but linux doesn't), line endings (CRLF vs. LF), etc. 

Link to comment
Share on other sites

  • Krydos locked this topic
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...