This is a pretty broad question, but I'm hoping there is a solution. I realize that trying to do anything serverside that is done client side is kind of a contradiction in terms, but am hoping there is a way to emulate client side page rendering in PHP.
I have a website that converts reports generated with php/mysql as well as data from an api. I am also using chart.js to display graphs. My client wants to be able to send these reports on a monthly basis via email to his clients. I figure that cron jobs would accomplish this, but am now stuck with how to generate the content without a browser.
The site is hosted on godaddy, so I don't have comand line access or anything like that. Basically just ftp and mysql access.
If you have ssh access, then this job becomes much easier by phantomjs and your api. Create HTML report by phantomjs and get the generated contents by file-get-content. Then send it by email.
A few options here I think. In the specific case you've outlined, only 1 and 2 are appropriate, but I've popped 3 in as it might help others. Side note, if GoDaddy has cPannel, you should be able to set up cron jobs from there, and then Option 2 might be most appropriate.
Option 1 (least work):
After rendering POST the image back to the server for emailing.
Option 2 (least technology):
Use a PHP chart library for both server side and client side charts. Remove the old code.
Option 3 (seperation of concerns):
Run a seperate NodeJS service so that you can do server side rendering using the same code you'd use for client side rendering. Call to it from the PHP service to get the images rendered.