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.

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

报告相同问题?

悬赏问题

  • ¥15 mmocr的训练错误,结果全为0
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀