best way to troubleshoot a php file... that displays nothing

Hi,

I was trying to make a simple script that, when contacted by the paypal IPN server, sends an email to the person sending money that says basically thanks for donating. However, when I send a test message from the paypal IPN simulator, it says failed, status code 500 internal server error. I don't know how I can troubleshoot this, as for one, it uses post to send the data, not get, and two, even when I tried using get just to troubleshoot, it displayed absolutely nothing on the page.

Any help is appreciated.

Thanks,

-Michael.

3 Replies

Check the web server error logs and whatever language your php error logs, one or both should have something in it.

Internal server error probably means that EALL / ENOTICE is off. You will want to change these with ini_set(), or a .htaccess file.

php.ini, ensure log_errors is on.

Check the server error log next.

If you want to try grabbing the error at runtime, try adding this in your script near the top of the execution flow…

@ini_set('display_errors', 'On');
error_reporting(E_ALL);

Note that you'll get all notices, warnings, strict notices, deprec notices (if running PHP 5.3) when you do this. If that happens, it also means you've got some code to clean up.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct