Skip to Content
It is currently September 27th, 2022, 7:26 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: April 5th, 2021, 7:43 pm 
Offline
New User
New User

Joined: April 5th, 2021, 7:33 pm
Posts: 5
Hello,

I am working on setting up a webserver on the same PC (win 10) as Sam broadcaster.

I have not found much for information on how to make Sam work on the same system. It needs an FTP but I don't need an FTP. I can direct apache to the Sam Pages but I don't know if it should be to the Sam Folder in Appdata or the program files.

Also, there isn't any documentation about Sam's PHP beyond PHP5. I have the latest version (PHP8) installed. Will it work with 8 or do I have to use the much less secure version 5?

it really seems like Spacial has not updated Sam for Web use in some time nor added documentation for users to update the files themselves for compatibility.

My goal is to have links from my website from my main host to link to Sam's PHP pages on my localized web server since there isn't any way to have the pages connect to the database on a remote server. At least nothing in the documentation I have found.

This should be an easy thing to do, but without documentation it's proving otherwise.


Top
 Profile  
Reply with quote  
PostPosted: April 6th, 2021, 8:13 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8306
Location: Cologne (Germany)
Quote:
Also, there isn't any documentation about Sam's PHP beyond PHP5. I have the latest version (PHP8) installed. Will it work with 8 or do I have to use the much less secure version 5?


SAM PHP web was updated for PHP7 in April 2018 / SAM 2018.3
Obviously if you're still using SAM 4 or SAM 2013 (or in reality anything before the release of PHP7), you have to live with only PHP5 compatibility.

I haven't yet tried it with PHP8, but I don't expect any problems after I fixed all the PHP7 problems in 2018.

Quote:
My goal is to have links from my website from my main host to link to Sam's PHP pages on my localized web server since there isn't any way to have the pages connect to the database on a remote server. At least nothing in the documentation I have found.

Using the web templates with a remote database is no problem at all. (Just enter the IP/hostname where it says localhost by default in dbconfig.xml.php)
Using SAM itself with a remote database has been problematic in the past due to high latency. If you've got a sufficiently fast network connection to your database server, that shouldn't be a problem in 2021 anymore either. (I'd still not recommend it due to SAM not being transaction safe and failure to connect to the database will bring your station to a halt)

Quote:
It needs an FTP but I don't need an FTP. I can direct apache to the Sam Pages but I don't know if it should be to the Sam Folder in Appdata or the program files.

FTP is only needed for the HTML templates to update themselves and for the pictures to be uploaded automatically whenever you add new tracks.
If you don't need those features, you can transfer the files by hand.

I'd recommend using the files in AppData, that way you don't need to run in Admin mode to edit the config files, but the SAM softrware itself doesn't need write access to the PHP files, so for PHPweb it would be fine to use the files in Program Files as well.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: April 8th, 2021, 8:05 pm 
Offline
New User
New User

Joined: April 5th, 2021, 7:33 pm
Posts: 5
I'm using the latest version of Sam Broadcaster pro. 2020.3 I think it is.

Quote:
Using the web templates with a remote database is no problem at all.


For clarification: If I put my Host PC IP (with port forwarded to the data base 3306) than the web pages hosted on my domains.com account will querry the Database on my PC?

I've struggled getting this to work in the past. I don't have a good understanding of how PHP works out side of PHPBB forums.

All I need to do is make sure my IP:3306 is in the dbconfig.xml.php and everything will work?

I don't need to set up a database on my web server hosting account? It will access the same PC that's running Sam?

Sorry if this sounds redundant. I am attempting to learn to code...

I'll work on this tonight. Is there any documentation on how I can create modules for wordpress from the SamPHPwb templates? IE: Stand alone top 10 requests, Up Next etc?

What HTML5 player would you recommend for a wordpress site? None of the Sam Plugins I have found seem to work. They are out dated.


Top
 Profile  
Reply with quote  
PostPosted: April 8th, 2021, 9:30 pm 
Offline
New User
New User

Joined: April 5th, 2021, 7:33 pm
Posts: 5
Correction 2020.6


Top
 Profile  
Reply with quote  
PostPosted: April 10th, 2021, 8:39 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8306
Location: Cologne (Germany)
PhoenixRadio wrote:
For clarification: If I put my Host PC IP (with port forwarded to the data base 3306) than the web pages hosted on my domains.com account will querry the Database on my PC?

Yes, that's the way it's supposed to work.
Pay attention: If your ISP has already switched to DS Lite, you can't use the IPv4 address, but must use the IPv6 one.

PhoenixRadio wrote:
I've struggled getting this to work in the past. I don't have a good understanding of how PHP works out side of PHPBB forums.

phpBB works just the same: Change the address for the database server in your config php and make sure your MySQL/MariaDB is publicly accessible and that your MySQL user is allowed to connect from either any host or at least the external server IP.
I think by default access is limited to localhost only.
If you have a second computer or a phone at hand and can install any MySQL client there, that's a great way to test it.

PhoenixRadio wrote:
I'll work on this tonight. Is there any documentation on how I can create modules for wordpress from the SamPHPwb templates? IE: Stand alone top 10 requests, Up Next etc?

https://developer.wordpress.org/plugins/
That and probably the documentation of your Wordpress theme.

As for how the top10 and up next mechanisms work, there's no documentation, you'll have to look at the code in the samPHPweb templates and see how they solved that.

Alternatively you can look at this wordpress plugin by Festerhead, but I'm not sure if it's compatible with PHP7/8 or recent Wordpress releases as it was built about 10 years ago and Festerhead has retired from Radio & this online community in particular.
https://github.com/mastacheata/fescon/t ... ter/fhrsam (the fhrsam folder contains the actual wordpress plugin and the pal folder contains PAL scripts used to change your database to a format that was easier to handle for the limited programming skills of Festerhead at the time - He isn't a software developer by trade, but was pretty well-known in all things SAM and learned how to build some stuff)

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: April 12th, 2021, 3:04 pm 
Offline
New User
New User

Joined: April 5th, 2021, 7:33 pm
Posts: 5
How do I get the php pages to show up? Only the HTML ones upload via FTP.


Top
 Profile  
Reply with quote  
PostPosted: April 12th, 2021, 4:35 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8306
Location: Cologne (Germany)
You manually upload the files to your server, of course.
The PHP files don't change each time a track changes, so there's no need for SAM to upload new files automatically for you.

You mentioned you had previously installed phpbb, this works just the same way as that or Wordpress or any other PHP script for that matter.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: April 12th, 2021, 7:38 pm 
Offline
New User
New User

Joined: April 5th, 2021, 7:33 pm
Posts: 5
With PHPBB there is an install.php file I need to load first. I don't see that with Sam.

Also I have my location as domain.com/sambc where the html files are uploading to (but not with the template, it's all in plain text not sure how to fix that) Do I need to then point to the samPHPweb folder for the php to work? (/sambc/samPHPweb/)

I've gone as far as domain.com/sambc/samphpweb/web/index.php and return with no results.


Top
 Profile  
Reply with quote  
PostPosted: April 14th, 2021, 3:15 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8306
Location: Cologne (Germany)
That depends on your webhost.
Usually you have either an htdocs or public_html folder at the root of your ftp account which is where you would put the files.
Also if you have an htaccess file at the root of your site defining rewrite rules, you might need to adjust that.

This is however beyond the scope of help we're usually providing in this forum as it's not really specific to SAM or samPHPweb, but generic webhosting knowledge.
If you need more detailed advice, you should ask your webhost or a forum specifically into webhosting/php (You could also try the Spacial support, but I believe even their admins have no clue of setting up a website, given how often audiorealm.com breaks and how long it takes them to update their scripts for new PHP versions).

If you're looking for direct/personal help, feel free to get in touch with me via PM or E-Mail, but beware I'm building websites for a living and therefore my services aren't free.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: May 1st, 2021, 9:53 am 
Offline
Junior User
Junior User

Joined: April 27th, 2020, 6:15 pm
Posts: 40
Here's my advice, and i apologize if it's not what you need.

You are pounding sand with PHP and wordpress.

SAM now comes with great template files, i.e. - _history.json, _queue.json, _requests.json and the like. You can compile these into one very nice JSON file to upload to your webhosting domain in some random folder.

Learn any frontend framework - React, Vue, Angular, Django...
You can make a private repo on GitHub for free, add a CNAME file to your repo to point to your domain. Watch a 3 hour Udemy class or one of the millions of YouTube tutorials on how to use JSON files for frontend output with if checks and for loops.

You can pull your hair out opening this port and that port and contacting your hosting provider and blah, blah, blah. Or, just use 1 simple file to format how ever you want. No need to connect to a database from anywhere, no need to have special admin permissions for this and that.

You can use Heroku or Netlify and the like to host your repo instead of paying gross amounts of money to hosting companies. I pay $5-15/month based on usage. I used to do the whole PHP thing with Bluehost/Joomla, payed $1200/year for crap. Had to use all sorts of hacks, including festerhead stuff (which is 10+ years old).

Wordpress is the pretty girl with issues. Everyone is attracted to it, no one wants to keep it once they find out how crazy it is.

All the time you spend on getting SAM, PHP, Wordpress, ports, permissions, port forwarding, plugins, custom PAL scripts and stuff to play nice could be better spent learning any modern language and using 1 JSON file to rule them all!

(just my opinion, from someone that went though all you're going through :) )


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group