dqnf28092 2016-12-14 01:05
浏览 83
已采纳

PHP通过防火墙显示不同

I am playing around on my personal website with some PHP and MySQL. At home, everything displays fine. At work, however, if the PHP code is using GD to manipulate images nothing ever shows up on the page. If it is just displaying HTML, it shows the HTML tags along with the text without ever formatting it. It takes a very long time to finish being busy even if it has displayed all the information already.

This obviously seems to me to be a security setting on my work firewall, but I know of PHP sites that I can access which do not have that issue. Is there a setting in PHP which I have not set up which might be causing this? Does this sound familair to anyone?

One of the example bits of code I was using was

<?php

echo '<HTML><HEAD></HEAD><BODY>';

//For loop to loop through this 100 times
for ($x = 1; $x <= 100; $x++) {
//Generate three random R, G, and B integers for an RGB value using mt_rand()
$r = mt_rand(0, 255);
$g = mt_rand(0, 255);
$b = mt_rand(0, 255);

//Turn them into a hex code:
$hexCode = dechex( (($r & 0xFF) << 16) | (($g & 0xFF) << 8) | ($b & 0xFF));
echo 'RED: ' . $r . ' GRN: ' . $g . ' BLU: ' . $b . '<BR>Hex Code: '. $hexCode . '<BR><BR>';
// End Bracket for the For loop
}
echo '</BODY></HTML>';
?>

As you can see, nothing too fancy.

I have tried to open this page in Firefox, Chrome, and IE, it only 'fails' at work. In this case, it fails by displaying some number (which isn't echoed in the code at all), and then the page with HTML visible not treated as a markup.

snippet of HTML output

Anybody know some way to get my simple test pages displaying on my work computer?

I am using personal development time to refresh my memory on some PHP concepts and MySQL concepts in preparation for an upcoming project. I wanted to use my personal server to run these test programs rather than cluttering the work linux box I share with my partner up with my personal workspace. Any help would be appreciated!

  • 写回答

1条回答 默认 最新

  • dongmeng4742 2016-12-14 19:29
    关注

    So the site when attempting to load the page had no SSL Certificate. I had previously not needed one, but some settings had obviously been adjusted at my work's network security.

    However, since I was accessing the site the way I had previously, through HTTP://sitenamehere.etc/pagename.php, no browser displayed an error that it wasn't loading specifically because there was no SSL...it was simply processing the output while displying the HTML as plain text and without displaying any of the images.

    Using the browser's developer tools to view the network tab, I could see that the site was being flagged as not being secure. Generating a self-signed SSL and accessing the page from HTTPS://sitenamehere.etc/pagename.php finally displayed the 'This site is not safe!' dialog page and allowed me to add an exception.

    Thanks to Michael Berkowski for walking me through these troubleshooting steps that led to this solution. Hopefully this helps other people out there learning PHP while accessing it remotely.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 Unity接入微信SDK 无法开启摄像头
  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源