Page 1 of 6

New PHP Upload Process

Posted: Wed 26 Apr 2023 8:51 am
by mcrossley
If you are thinking of trying out the new PHP upload process, please read the Wiki page on how to set it up here: https://www.cumuluswiki.org/a/PHP_Uploads

NOTE: It is not a requirement to change to using the PHP Upload method. The existing FTP/FTPS/SFTP methods remain fully supported and operational.

Re: New PHP Upload Process

Posted: Wed 26 Apr 2023 10:32 am
by water01
Further to this I don't know if it any help to anyone else but when I switched to PHP uploads I did the following.

I first copied my existing Cumulus.ini to another file elsewhere and then I edited it. This allowed me to change all the existing uploads to the relative position of the PHP uploads file (I have 15 uploads) and then I also added the additional items that that the PHP upload required and copied up the PHP upload program to my website.

I then stopped CumulusMX and copied the old cumulusMX.ini SFTP file and saved it and then substituted my newly edited copy. Started CumulusMX and tested the upload feature by using the FTP/Copy function. I had, in my case one error that I had forgotten about the NOAA reports as that had to change as well.

Made that change and bingo all was well. In all it took about 20 minutes.

Re: New PHP Upload Process

Posted: Wed 26 Apr 2023 12:57 pm
by Nottub
Now my next hurdle as I'm getting an Error:500(error) Error processing website Settings. The method or operation is not implemented.

Steps so far:

1) Changed upload in 'Internet settings' to php;
2) Copied secret code from 'Internet Settings' (once .php is selected) and updated the CMX .php file where indicated (in between the '....' marks);
3) Updated URL in 'Internet Settings' to: https://calvertoncam.co.uk/weather/upload.php;
4) Uploaded the amended .php file from CMX to my website in the weather folder using Filezilla;
5) revisit the Internet settings folder and when selecting 'Save Settings' get the Error:500(error), mentioned above.

On a side note I am still on 3:24:2 b3235

Sorry to be an absolute :|

Martyn

Re: New PHP Upload Process

Posted: Wed 26 Apr 2023 1:51 pm
by water01
You haven't followed the instructions on entering the secret code that CumulusMX generates and put it into the appropriate place in upload.php as it is saying "You must change the default secret", which is the error message you get when this your shared secret does not match the one in upload.php.

Re: New PHP Upload Process

Posted: Wed 26 Apr 2023 2:12 pm
by Nottub
I have checked, and repeated the process for copying and updating the 'Secret Code' in the Cumulus 'upload.php' file and saved it again.

Opened it in CMX to check it has the correct code (which it has) and uploaded it again to the server.

Opened it on the server to check and it does have the correct code.

Should I be removing the ' before and after where the secret code goes or do they remain in place?

I cant see anything else i'm missing.
MX Screenshot.jpg
This is the 'upload.php' file on the server with the Secret Code added:

At this location:

Re: New PHP Upload Process

Posted: Wed 26 Apr 2023 2:55 pm
by PaulMy
@Nottub, interesting that a few minutes ago your https://calvertoncam.co.uk/weather/realtime.txt and https://calvertoncam.co.uk/weather/realtimegauges.txt are updating... but now have not updated for over 10 minutes. Possibly you are making changes or tests?
Should I be removing the ' before and after where the secret code goes or do they remain in place?
Yes, remain in place, so you have that correct.

Enjoy,
Paul

Re: New PHP Upload Process

Posted: Wed 26 Apr 2023 3:05 pm
by Nottub
Seems OK after a restart..... :clap:

Don't know how to update the 'Extra Webfiles' though, as they aren't uploading. I know the suggestion is to make the reference relative but i'm not sure what that means.

If I had a webcam image destination filename as 'weather/images/webcam.jpg', what should this be changed to?

Sorry I'm thick, but am trying.

Martyn

Re: New PHP Upload Process

Posted: Wed 26 Apr 2023 3:19 pm
by freddie
Yes, restart required.

You should change the paths relative to where the PHP upload page is on your site. So if it is in the weather directory then your path for your example extra file will be this:

Code: Select all

images/webcam.jpg

Re: New PHP Upload Process

Posted: Wed 26 Apr 2023 3:31 pm
by Nottub
I'm going to have to come back to this, i'm getting angry now that the webcam won't upload despite the changes made :evil: .

The banner text won't update (realtime.txt file) on the server, goodness knows what else isn't working.

Sorry but I need to come back to this later. :!:

Martyn

Re: New PHP Upload Process

Posted: Wed 26 Apr 2023 4:04 pm
by Nottub
Reverted to ftp.

Turns out no new data was being uploaded in .php!

realtime.txt (not uploading)
realtimegauges.txt (not uploading)

Don't know what the issue is!

Sorry I'm just not a technical person.

Martyn

Re: New PHP Upload Process

Posted: Wed 26 Apr 2023 4:09 pm
by water01
If you upload a copy of the MXDiags .txt file for the php uploads perhaps we can find the problem.

Silly question PHP is implemented on your host?

Try uploading the attached file (once unzipped) to your website and run https://www.yourwebsite/phpinfo.php to check it.

Re: New PHP Upload Process

Posted: Wed 26 Apr 2023 5:22 pm
by Nottub
I presume this means it's ok?

php check.jpg
I'll try .php uploads tomorrow and turn on 'Debug' and 'Data Logging' before I do so.

Thanks for your patience.

Martyn

Re: New PHP Upload Process

Posted: Wed 26 Apr 2023 5:36 pm
by water01
Yes that eliminates one question, so now we need to see a MxDiags file from when you were running phpupload.

By the way you should delete the phpinfo file from your server as it is not a good idea to leave it there.

Re: New PHP Upload Process

Posted: Wed 26 Apr 2023 6:03 pm
by Nottub
Looking at the initial diagnostics it looks like I need to change the 'default secret'.

EXTRACT: 2023-04-26 18:47:17.468 PHP[0]: realtime.txt: Response text follows:
You must change the default secret


If this is the case do I overwrite it in the 'Internet settings' with whatever numbers I choose?

Then copy this into the MX version of 'upload.php

Finally upload to my server?

Martyn

20230426-184525.zip

Re: New PHP Upload Process

Posted: Wed 26 Apr 2023 6:08 pm
by Nottub
BTW:

I use the PC interface with MX to update the Internet settings.

Copy and paste into MX on the RPi to update the 'upload.php'.

Then copy back to the PC and use Filezilla to send to my service providers server. Which I view to check it's correct.

Martyn