简体   繁体   English

网站在本地但不在在线服务器(WAMP)上运行

[英]Website working on local but not on online server (WAMP)

Good morning. 早上好。

I'm having a problem with some .php files that I wrote to implement the PHPMailer on a website. 我为在网站上实现PHPMailer而编写的某些.php文件存在问题。 I wrote all the code locally using WAMP Server (ver 2.4) and, when testing, it all worked fine. 我使用WAMP Server(版本2.4)在本地编写了所有代码,并且在测试时一切正常。 And then the problems began, because when I uploaded the files on the server in wich the website is located, instead of redirecting to the .php files and execute them, I obtained only blank pages. 然后问题就开始了,因为当我将文件上传到位于该网站的服务器上时,而不是重定向到.php文件并执行它们,而是仅获得空白页。

I thought that the problem could be the folders path, but I checked them and they where correct. 我以为问题可能出在文件夹路径上,但我检查了它们,发现它们在正确的位置。 At that point, I thought that the problem could have be the PHP version that was older on WAMP server (ver 5.4.16) than in the website server (ver 5.4.45). 当时,我认为问题可能是WAMP服务器(版本5.4.16)比网站服务器(版本5.4.45)更旧的PHP版本。 So I tried to install PHP ver 5.4.45 on my WAMP server too, but I had an error where it was said that this PHP version was not compatible with the Apache version. 因此,我也尝试在WAMP服务器上安装PHP ver 5.4.45,但是出现错误,提示该PHP版本与Apache版本不兼容。 So I tried to install another version of Apache as well, but then it didn't work because another version of PHP was needed. 因此,我也尝试安装另一个版本的Apache,但是由于需要另一个版本的PHP,所以它不起作用。

After that, I completely uninstalled WAMP server and installed the latest version (ver 3.0.0) and tried executing the .php files with PHP ver 5.6.16, and actually they worked without any problem. 之后,我完全卸载了WAMP服务器并安装了最新版本(版本3.0.0),并尝试使用PHP版本5.6.16执行.php文件,实际上它们可以正常工作。

After that, I tried to install PHP 5.4.45 on this new version of WAMP server too, but gave me same problem of the Apache version. 之后,我也尝试在此新版本的WAMP服务器上安装PHP 5.4.45,但给了我同样的Apache版本问题。 I can't really understand what the problem could be, someone has had this problem or similar to me before and solved it? 我真的不明白问题可能是什么,有人曾经遇到过这个问题或与我相似并且已经解决了?

I used this tutorial to install the PHP ver 5.4.45 on WAMP ( http://forum.wampserver.com/read.php?2,125016,125018 ) and I did all the steps, so I can't understand why it does not work on the server. 我使用本教程在WAMP( http://forum.wampserver.com/read.php?2,125016,125018 )上安装了php ver 5.4.45,我做了所有步骤,所以我不明白为什么在服务器上不起作用。

A blank, white page when viewing a PHP page usually means there's been a fatal error which has stopped the page from loading. 查看PHP页面时,空白页面通常表示出现致命错误,导致该页面无法加载。

By default, errors are not set to be displayed on the screen, but they will be in your server log files. 默认情况下,未将错误设置为在屏幕上显示,但它们将在服务器日志文件中。 These will usually be called something like apache logs, or error logs. 这些通常称为apache日志或错误日志。 Your web host will help you find these. 您的虚拟主机将帮助您找到这些。

These will then tell you what the error is, on what page, and what line number. 然后,它们将告诉您错误是什么,在什么页面上以及什么行号。

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

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