0

Good morning.

I'm having a problem with some .php files that I wrote to implement the PHPMailer on a website. I wrote all the code locally using WAMP Server (ver 2.4) and, when testing, it all worked fine. 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.

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). 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. So I tried to install another version of Apache as well, but then it didn't work because another version of PHP was needed.

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.

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. 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.

Giada
  • 3
  • 2

1 Answers1

0

A blank, white page when viewing a PHP page usually means there's been a fatal error which has stopped the page from loading.

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. Your web host will help you find these.

These will then tell you what the error is, on what page, and what line number.

Lee
  • 4,187
  • 6
  • 25
  • 71
  • Answering also to @Minzkraut, since I'm trying to solving the problem since yesterday, I found some lines of code that allowed me to see the error of the php file executed (from http://stackoverflow.com/questions/1053424/how-do-i-get-php-errors-to-display), but the page didn't display any error at all. On the server I found a folder named "logs", containing only some .gz files, two of them recents. They contained a .txt files, but there are no errors displayed in it. – Giada Jun 30 '16 at 10:09
  • Does your web host provide a feature to read the logs within a control panel? What control panel do you use? – Lee Jun 30 '16 at 10:31
  • I used FileZilla to search in the folders. Now I'm contacting the web host staff, to see if they can help me finding these logs. – Giada Jun 30 '16 at 10:36
  • Ok, so the staff told me I don't have access to the logs, and suggested me to upload the files on the server and they will see if they can solve my problem. But since your answer helped me on finding another way to solce the problem, I'm accepting it as the best solution! Thank you! – Giada Jun 30 '16 at 10:52
  • They won't let you access the logs? That's strange.. you should be able to view your own website error logs. I think you should insist to see them. YOu shouldn't really always rely on the webhost to fix your own coding errors. – Lee Jun 30 '16 at 13:04
  • I was surprised too, in fact I don't know how they will resolve the problem. In the meanwhile I'm trying to do others tests, obtaining: "Fatal error: require_once(): Failed opening required '\PHPMailer\class.smtp.php' (include_path='.:/usr/lib/php:/usr/local/lib/php')". I tried changing the folder addresses but it doesn't work. At this point I don't know really what to do anymore... – Giada Jun 30 '16 at 13:09
  • That could be because of the initial slash at the start of the path. Alot of times, errors like 'Failed Opening', are to do with paths not being right. They might need to be absolute, or relative.. depending on what you're doing. But having that error message is much more useful, if you post that in another question.. you may get some good responses. – Lee Jun 30 '16 at 13:14
  • No problem, I managed to solve the problem, now everything works fine! :) Thank you again! – Giada Jun 30 '16 at 14:34