Help Installing Software Built on Laravel?

Status
Not open for further replies.

natsx10m

New Member
Messages
3
Reaction score
0
Points
1
The software I used to use is unsupported as of 2014 I believe. I'm trying to set up a small board for my group.

This is what I'm looking at now. https://github.com/infinity-next/infinity-next

When reading the installation instructions I get to step 3 which is, "Issue the command 'composer update' and wait as 3rd party libraries are added."

I see this is built on Laravel, it seems like most things built on Laravel are like this. Is this possible on x10?

Thanks for any help in advance.
 
Last edited:

caftpx10

Well-Known Member
Messages
1,534
Reaction score
114
Points
63
Free hosting does not allow SSH access. Therefore, running such commands will not be possible.
 

natsx10m

New Member
Messages
3
Reaction score
0
Points
1
Right, I figured. But is there any way to ask the host to issue the commands or is there some way to work around this? Pretty much everything requires Composer now if it's done in PHP and requires some kind of command.
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
The actual files you need to run the site are pretty much all PHP and text/config (and the database(s), of course), so you can do everything on a local machine, then just upload the result. (Or you could avoid "big stack"/framework nonsense altogether, especially when you have limited server resources to work with. It's basically a trade-off of low developer effort against reduced efficiency.)
 

krixanox

New Member
Messages
3
Reaction score
0
Points
1
You can run artisan commands from a route/controller by using `Artisan::call('command', [parameters])`.
This is what I use to run the 'artisan migrate', 'artisan optimize', 'artisan config:cache', and 'artisan route:cache' commands on the server. (source: https://stackoverflow.com/questions/37236206/run-artisan-command-in-laravel-5)

For Composer Install/Update, I simply do this before I upload it to the server. You would want to do 'composer install --no-dev' to make sure you aren't putting dev-only files on the server. When you go to upload it to the server, make sure you are including the 'vendor' folder.

To help speed up the process of uploading the site to the server, I just make a batch/bash file with all the commands I need to do, adding on to that a zip command to zip all the folders and files I would need to upload to the server, and then a command reverting back to the files before I ran the shell script (using `git checkout -- .`). I then simply upload the zip file from the online cpanel file explorer and unzip it from there in the correct directory, but only after I have already deleted the old files and folders (except for the `.env` file). You could also probably have an ftp command in the shell file to automatically upload the zip file onto the server - but you would probably still need to unzip it from the file manager on cpanel.

This is the code I use for the bash script:

Code:
#!/bin/bash
# Distribute website

# make sure all the cache is cleared
php artisan route:clear
php artisan config:clear
php artisan cache:clear
php artisan view:clear

# use production files only
npm run production
composer install --no-dev

# zip required files and folders for server
zip -r ./updates/update$1.zip ./app/ ./bootstrap/ ./config/ ./database/ ./public/ ./resources/ ./routes/ ./storage/ ./vendor/ ./artisan ./composer.json ./composer.lock ./package.json ./phpunit.xml ./server.php ./webpack.mix.js ./yarn.lock

# add zip file to git and revert back to dev files
git add ./update$1.zip
git commit -m "add update zip"
git checkout -- .
composer install


I would run this command passing in the version number as an argument: `./dist.sh 1.5`. Also, you may need to add more directories or files that are being zipped up in the shell script.

Hope this helps!
 
Last edited:

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
You're very likely to run into problems with write permissions and execution times in the Free Hosting environment. A cron may solve the permissions issue, but execution time is a hard limit, particularly when you're as memory- and IO-bound as you are on a Free Hosting server.
 
Status
Not open for further replies.
Top