Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

PHP code in Cumulus index.htm (indexT.htm)

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

Post Reply
User avatar
PaulMy
Posts: 3777
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis VP2 Plus 24-Hour FARS
Operating System: Windows8 and Windows10
Location: Komoka, ON Canada
Contact:

PHP code in Cumulus index.htm (indexT.htm)

Post by PaulMy »

While trying the beteljuice sun plot test and cleaning up some code (which is still a work in progress) in my www.komokaweather.com/weather page I have finally come to realize why there are items that are no longer displaying. I have some <php scripts in the index.htm file and initially they all displayed. About a year ago I first noticed these were no longer displaying or not displaying correctly, so I REM most of them out. Now in my checking I see it is all the <php .... ?> that are not working. However if the index page is named index.php then they do work. If I recall correctly it was at the time I changed to CPanel and PHP 5.6 from 5.4 on my GoDaddy webserver.

The index.htm is uploaded by the normal Cumulus Standard Files update so I can't change the name to index.php through that. Is there another way to display PHP scripts in index.htm?

Enjoy,
Paul
Davis Vantage Pro2+
C1 www.komokaweather.com/komokaweather-ca
MX www.komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX www.komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX www. komokaweather.com/cumulusmx4/index.htm

Image
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: PHP code in Cumulus index.htm (indexT.htm)

Post by beteljuice »

See viewtopic.php?f=14&t=16850&p=129526&hil ... ad#p129526 and check the wiki.

... but I want you to dump the meta refresh and use ajax, - we'll get you there eventually :roll:
Image
......................Imagine, what you will KNOW tomorrow !
Mapantz
Posts: 1777
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: PHP code in Cumulus index.htm (indexT.htm)

Post by Mapantz »

This is what I use:

Code: Select all

AddType application/x-httpd-ea-php56 .html .htm
Drop that in .htaccess
Image
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: PHP code in Cumulus index.htm (indexT.htm)

Post by BCJKiwi »

You can rename the standard files.

Option 1
In CumulusMX Settings / Internet Settings / Web/FTP settings,
turn OFF (un-tick) include standard files.
Then,
In Extra Webfiles,
set up the local filename with the htm as it is in the web folder after processing
and
Remote filename with the destination address and php in place of htm.
Of course the file will need to behave as a php file.

Option 2
Alternatively you could rewrite the file as you want it as a php file using a different name, then send it instead of the standard index.htm file renaming it as described above in extra webfiles.

If you turn off Include standard files, you will also need to send all the other standard files as well via extra webfiles.
User avatar
PaulMy
Posts: 3777
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis VP2 Plus 24-Hour FARS
Operating System: Windows8 and Windows10
Location: Komoka, ON Canada
Contact:

Re: PHP code in Cumulus index.htm (indexT.htm)

Post by PaulMy »

Thanks everyone for your suggestion. Not what I was looking for as hoped there was a way within the standard processed indexT.htm/index.htm. I have gone by one of Brian's suggestion, and in fact what I had responded myself in another post as beteljuice linked in his reply.

I have created a duplicate indexT.php that Cumulus processes and named as index.php and now the PHP scripts do work in the homepage www.komokaweather.com (rerouted to wwwkomokaweather.com/weather/index.php). This is the only upload file I have added so indexT.htm still uploads to /weather/index.htm like all the other standard Cumulus processed files. So anyone going to /weather will get the non-php index.htm. Once I have things improved on the page I will likely stop the Cumulus standard files upload and have them all in the extra files section.

I tried Mapantz' .htaccess approach but that got me in to trouble. I edited the original .htaccess and must have done something way wrong as next thing I had was that anytime I went to my website from Firefox or Chrome it redirected to IE. Somehow I got that fixed but then now when I go to my www.komokaweather.com/weather/ in Firefox I get a "Save As" popup and actually can't go that that separate page. It is fine if I add the index.php or index.htm.
I hope it is only my weather computer here and that no one else gets this if they use www.komokaweather.com/weather/

One off-course thing worked out. Now back to betel's sun script... Or maybe scrap the whole page layout and do it completely new with more fixed page items and fewer Cumulus processing and uploads :|

Enjoy,
Paul
Davis Vantage Pro2+
C1 www.komokaweather.com/komokaweather-ca
MX www.komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX www.komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX www. komokaweather.com/cumulusmx4/index.htm

Image
Mapantz
Posts: 1777
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: PHP code in Cumulus index.htm (indexT.htm)

Post by Mapantz »

Ah. You might need a slightly different line in your .htaccess as it depends on your servers set up. I had that same issue when I first tried it out years ago. Generally though, that's the standard way to get PHP working within html/htm etc.

CGI:

Code: Select all

AddHandler cgi-script .html .htm
FastCGI:

Code: Select all

AddHandler fcgid-script .html .htm
Godaddy usage:

Code: Select all

Options +ExecCGI
AddType application/x-httpd-php .php .html
AddHandler x-httpd-php5 .php .html
I think you're with GoDaddy?
Image
Post Reply