Example Goal:
Tip: Makes sure the PHP version running in you local development is the same version on your remote server!
LOCAL DEV
$ cd HOSTING_FOLDER_NAME
$ git init
$ git add .
$ git commit
Create repo in github and copy the URL of the new REPO.
$ git init
$ git add .
$ git commit -m "202404131945pm initial commit"
$ git remote add production https://github.com/USER/repo.git
$ git remote -v
$ git push production master
https://dash.cloudflare.com/[ID]/domain.com/dns/records
Example: sub.example.com
Login to Hestia control panel: https://hpc.domain.com:2083/login/
Create a domain sub domain: example.domain.com
$ cd /home/edwin/web/secured2.domain.com
$ ls
OUTPUT:
cgi-bin document_errors logs private public_html stats
$ cd private
$ mkdir laravelUploadV2
$ cd laravelUploadV2
$ git init
$ git remote add production https://github.com/[user]/upload_image_v2.git
$ git pull production master
$ username:
$ password: TOKEN [you can find it in my claves expires 4/12/2025]
$ composer install
--optimize-autoloader --no-dev
>>>>>>>>>>>>>>>>>>>>>> ERRORS <<<<<<<<<<<<<<<<<<<<<<<<<
Error #1: Your lock file does not contain a compatible set of packages. Please run composer update.
Solution: $ composer update
Try again:
$ composer install
--optimize-autoloader --no-dev
It worked!
202404130806pm - Error #2: Your requirements could not be resolved to an installable set of packages.
Root composer.json requires php ^8.1 but your php version (8.0.27) does not satisfy that requirement.
Solution: Login to Hestia Control Panel for the domain and under Advanced, select PHP-8_1
NOTE: To update, i had to reboot. I also did$ sudo apt-get update
$ sudo apt-get install php
Try again:
$
composer update
$ composer install
--optimize-autoloader --no-dev
Mmake copy and open .env to update database infromation
$ mv .env.example .env
$ nano .env or vim .env
APP_NAME
APP_ENV=production
APP_DEBUG=false
APP_URL=https://DOMAIN.COM
DB_CONNECTION
DB_CONNECTION=mysql
DB_HOST=xxxxxxxxxxx
DB_PORT=3306
DB_DATABASE=xxxxxxxx
DB_USERNAME=xxxxxx
DB_PASSWORD=xxxx
For Twilio If any:
# SMS TEXT MESSAGES
TWILIO_SID=xxxxxxxxxx
TWILIO_TOKEN=xxxxxxxx
TWILIO_FROM=+xxxxxxx
[SAVE CHANGES]: esc + Shift : > wq$ php artisan key:generate
$ php artisan migrate
$ php artisan config:cache
$ php artisan route:cache
$ php artisan view:cache
$ php artisan storage:link
$ cd /home/edwin/web/secured2.DOMAIN.com
Thats done for the private/ folder, now lets open the /public file of laravel into the hosting public folder.
video t=411
BACKUP Original public_html
$ sudo mv public_html public_html_OG
NOTE: su - Does not work!!
CREATE SYMBOLIC LINK
sudo ln -s private/laravelUploadV2/public public_html
sudo chown edwin:www-data
private/laravelUploadV2/public
>sudo chown -h edwin:www-data public_html
ls -la
drwxr-x--x 3 edwin edwin 4096 Jun 21 07:30 private
lrwxrwxrwx 1 edwin www-data 22 Jun 22 18:20 public_html -> private/laravelUploadV2/public
drwxr-x--x 2 edwin www-data 4096 Jun 21 07:27 public_html_OG
dr-xr-x--x 2 edwin edwin 4096 Jun 21 07:27 stats
LOCAL DEV
ANY CHANGES IN THE LOCAL DEV, just push the new changes to github
/f/apachefriends/xampp/htdocs/over-imgV5/REACT/MYOWN/IONIC/BACKEND-laravel-api-template/laravel-api-upload$ git push production master
PRODUCTION REMOTE:
~/web/share.[DOMAIN].com/private/laravel/$ cd HOSTING_FOLDER_NAME
$ php artisan down
$ git pull production master
User: [email protected]
Password: example key location: g/Program Files/winscp/keys/Hestia-SSH/github.txt$ php artisan optimize
$ php artisan view:cache
$ php artisan up
Video: X6t7xw1HU-s