简体   繁体   English

网站的功能与我的localhost(沼泽)服务器上的功能不同

[英]Website doesn't function the same way as it does on my localhost (wamp) server

First off, I ran into this issue when transferring all of my files from my localhost (wamp server) to my web server via FileZilla. 首先,通过FileZilla将所有文件从本地主机(垃圾服务器)传输到Web服务器时,我遇到了这个问题。 Everything works great on my test server but when looking at it on my domain it doesn't appear the same nor does it function the same. 一切在我的测试服务器上都运行良好,但是在我的域上查看时,它看起来并不相同,功能也不相同。

I tried to research this issue before asking and closest thing I found was this question here which doesn't help me with my specific problem. 我试着问前研究这个问题,我发现最近的事情便是这一问题在这里不帮我具体的问题。


What my test servers looks like and how the website should function on the web-server: 我的测试服务器的外观以及网站如何在网络服务器上运行:

  • Show the sign-up and sign-in buttons on the navigation bar. 在导航栏上显示注册和登录按钮。
  • Show the proper content accordingly from the action page. 从操作页面上相应显示适当的内容。

What my website is doing when uploading it to the web-server: 我的网站将其上传到网络服务器时正在做什么:

  • Shows the sign-up & sign-in buttons when navigating to the website ( www.heartfx.org/test ) 导航到网站( www.heartfx.org/test )时显示sign-upsign-in按钮
  • Does not display proper content like my localhost server does with the action page . 没有显示正确的内容,就像我的本地主机服务器操作页面所做的那样。

So instead of a user being linked to an external page for each function like login.php, register.php, forgot_password.php etc... they are linked to a single page like http://www.heartfx.org/action.php?action=register_account where I then $_get['action'] and display each "page" . 因此,无需将用户链接到诸如login.php, register.php, forgot_password.php等每个功能的外部页面,而是将它们链接到诸如http://www.heartfx.org/action.php?action=register_account的单个页面http://www.heartfx.org/action.php?action=register_account ,然后在其中$_get['action']并显示每个“页面”

The code on my web-server for some reason doesn't display those "pages" but only the navigation bar on top of the page and nothing under it. 由于某种原因,我的网络服务器上的代码不会显示这些“页面”,而只会显示页面顶部的导航栏,而在其下方则不显示任何内容。


How /action.php?action=sign_in should look(as it does on local server): /action.php?action=sign_in外观(与在本地服务器上一样):

在此处输入图片说明

How /action.php?action=sign_in looks on the web-server: /action.php?action=sign_in在网络服务器上的外观:

在此处输入图片说明


Another thing to mention : I also have this question being posted / answered on, on another community where someone had me run the following line down the code until I ran into a spot where the line number didn't echo; 还要提到的另一件事是 :我也在另一个社区上发布/回答了这个问题,在该社区上有人让我在代码下运行以下代码行,直到遇到行号没有回显的位置为止。

echo '<br>Line: ' .__LINE__; die;

The line number echo 'd completely fine until I placed the line of code underneath a showHeader(''); 行号echo完全没问题,直到我将代码行放在showHeader(''); function in my action.php page . 在我的action.php页面中运行 When placing the line of code underneath a showHeader(''); 将代码行放在showHeader(''); function it did not echo the line number as it should with that statement. 函数它没有像在该语句中那样回显行号。

We figured it was due to something with the showHeader(''); 我们认为这是由于showHeader(''); function which is being included in common.inc.php but cannot figure out what is wrong with the function that is causing it to not display each "page" . 该函数包含在common.inc.php但无法找出导致该函数不显示每个“页面”的函数出了什么问题。 The code on the web-server is exactly the same it is on the localhost server other then database credentials. 除了数据库凭据外,Web服务器上的代码与localhost服务器上的代码完全相同。

UPDATE: So after sitting idle at an action page (specifically I was at /action.php?action=register_account ) for about 10 minutes and refreshing the page the module appeared as it should've when first loading the page. 更新:因此,在一个动作页面(特别是我在/action.php?action=register_account )上闲置10分钟并刷新页面后,该模块显示为第一次加载该页面时应有的状态。 When roaming around the page for a bit and refreshing a 2nd time it AGAIN goes blank and run into the same issue. 当在页面上漫游并刷新第二次时 ,AGAIN将变为空白并遇到相同的问题。

Finally tracked down what was causing this issue and how to fix it. 最后,找出导致此问题的原因以及解决方法。 Inside of the showHeader('') that I am calling is another checkLogin() function that includes a Teamspeak3 query that displays my teamspeak server. 我正在调用的showHeader('')内部是另一个checkLogin()函数,该函数包含一个显示我的teampeak服务器的Teamspeak3查询。 That query for some reason was messing up the rest of my code (including the action.php page where I am trying to display everything. 该查询由于某种原因而弄乱了我的其余代码(包括我试图显示所有内容的action.php页面)。

Also would explain why very rarely I seen the page actually work and refreshing it, again made the page blank (other then the navigation bar) because the teamspeak query was still loading - causing the rest of the page not to load. 还可以解释为什么我很少看到页面真正起作用并刷新页面,又再次使页面空白(导航栏除外),因为teampeak查询仍在加载中-导致页面的其余部分无法加载。

To fix this I simply removed the query from common.inc.php as it is not a mandatory function to have on my site. 为了解决这个问题,我只是从common.inc.php中删除了查询,因为它不是我网站上必须具备的功能。 Thanks to everyone that helped me track down the issue. 感谢所有帮助我找到问题的人。

/*       
// Don't report any php errors.
error_reporting(0);

// load framework files
require_once("includes/libraries/TeamSpeak3/TeamSpeak3.php");

// connect to server, authenticate and spawn an object for the virtual server on port xxxx
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://serverquerylogin:ATJ75oPF@63.251.20.99:14012/?server_port=14010&use_offline_as_virtual=1&no_query_clients=1");

// build and display HTML treeview using custom image paths (remote icons will be embedded using data URI sheme)
echo $ts3_VirtualServer->getViewer(new TeamSpeak3_Viewer_Html("includes/images/viewer/", "", "data:image"));

// Report all php errors again.
error_reporting(-1);
*/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM