Page 1 of 1

Custom upload script for PHP 7

Posted: Mon Feb 11, 2019 10:29 pm
by Padowan
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?

Re: Custom upload script for PHP 7

Posted: Mon Feb 11, 2019 10:34 pm
by madshi
I'm in the same position as you, with barely any knowledge about PHP. Hopefully someone else can help out here? :(

Re: Custom upload script for PHP 7

Posted: Tue Feb 12, 2019 10:12 am
by Padowan
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.

Re: Custom upload script for PHP 7

Posted: Wed Mar 13, 2019 8:01 am
by stuartclennett
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