Custom upload script for PHP 7

delphi package - automated exception handling

Custom upload script for PHP 7

Postby Padowan » Mon Feb 11, 2019 10:29 pm

I have been using the script from http://help.madshi.net/UploadPhp.htm with madExcept to send bug reports. This worked great until I was forced to upgrade to PHP 7.1 on my web server. Unfortunately my knowledge about PHP is very limited and I am having trouble debugging this.

There seems to be a problem with the authentication, so I have tried disabling that. However it also looks like the file class.phpmailer.php used by the script is having trouble with PHP 7, so I have tried using a newer version. But the newer file keeps failing in sending mails.

Can anyone please help me fix the upload script so it works with PHP 7?
Padowan
 
Posts: 2
Joined: Mon Feb 11, 2019 9:15 pm

Re: Custom upload script for PHP 7

Postby madshi » Mon Feb 11, 2019 10:34 pm

I'm in the same position as you, with barely any knowledge about PHP. Hopefully someone else can help out here? :(
madshi
Site Admin
 
Posts: 10083
Joined: Sun Mar 21, 2004 5:25 pm

Re: Custom upload script for PHP 7

Postby Padowan » Tue Feb 12, 2019 10:12 am

I seem to have found a solution myself. It was simpler than I thought. I managed to confuse myself by testing with another domain than I usually use.

The file class.phpmailer.php contains two calls to the function set_magic_quotes_runtime() which do not exist in PHP 7. Removing these two calls seem to fix the problem. They are probably there for a reason, but I don't know what to replace them with, and removing them seem good enough for me.

The madExcept Settings dialog still shows error icons for the settings, but it works in the program anyway. It might have something to do with the web site trying to redirect http to https.

One of the problems I ran into is that the server only accepts emails send to its own domain. That became a problem when I tried to test with another domain.

Also I had apparently forgotten that the .htaccess file needs the following, which were also missing on my test domain:
Code: Select all
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
</IfModule>


My problem seems to be solved now, but I am still interested if someone has a more correct solution.
Padowan
 
Posts: 2
Joined: Mon Feb 11, 2019 9:15 pm

Re: Custom upload script for PHP 7

Postby stuartclennett » Wed Mar 13, 2019 8:01 am

Hi all,

Just hit the same problem with PHP 7 and the custom script & watned to say thanks for the fix you mentioned -- removing the set_magic_quotes_runtime fix worked for me too.

Thanks again :D
stuartclennett
 
Posts: 26
Joined: Thu Dec 20, 2012 10:02 am


Return to madExcept

Who is online

Users browsing this forum: No registered users and 4 guests