moving ci4 app from localhost to onliine test server |
Can anybody guide me how to duplicate my localhost development app to a remote test server ?
Are there any HowTo's or guidelines? 1. Should I start with an empty directory as project_root? 2. Which command to invoke, `composer init` or `composer require codeigniter4/framework` ?
on the hosting i use i have more than 5 sub-directories in hosting space . lets take one called "golib" so in main hosting there is a directory called golib
inside that is .env and 4 directories app, vendor, public and writable . I use cpanel to make public directory where http requests are listned to . All i do is from a terminal cd into local host directory and zip each directory app, vendor, writable and upload to server. At the very beginning before uplaoding CI4 i create a public directory inside, sub domain directory and put a single index.html file. The reason is that from cPanel i use "lets encrypt " to set up using https. once i see https requests work i go to INSIDE public directory on local and use something like : Code: zip -r insidePublic.zip . notice trailing "." that puts contents only into a zip file. I then upload insidePublic.zip to inside of public directory of sub domain and remove the index.html
07-23-2024, 12:20 PM
(This post was last modified: 07-23-2024, 12:21 PM by cadgiru. Edit Reason: spelling )
@captain-sensible thx for Your answer.
In my particular case, I have a localhost for development, and a seflhosted webserver for testing... Localhost works fine, but have problems duplicating on remote test server. Have full ssh access to remote ubuntu LAMP webserver
If you have ssh access, you can use `rsync` (and ssh) to transfer your app code from local to the server.
Or if you have git repository for your app, you can use git (and ssh) to get your code in the server.
@kenjis thx
Does Your answer imply that a straight copy with rsync or for that matter a archived file of project is the only thing I have to do? Have the project in git, by default the git repository doesn't store vendor tree and hidden files and dirs . so options would be rsync, or changing parameters for git Will give it a go
There are many ways to deploy.
See - https://github.com/codeigniter4projects/...deploy.yml - https://github.com/codeigniter4projects/.../deploy.sh That is the workflow to deploy CodeIgniter website. When we merge into `master` branch, GitHub Action will deploy automatically. (07-24-2024, 02:18 AM)kenjis Wrote: There are many ways to deploy. @kenjis Thanks for reply, see I have a steep learning curve.. with ref. to https://codeigniter4.github.io/CodeIgnit...poser.html Could U tell me, what are the initial requirements for project root dir of remote server: composer init ? composer require codeigniter ? thx
If you have your git repository, log into your server, and
1. run `git clone ...`. 2. run `composer install` in the project root. |
Welcome Guest, Not a member yet? Register Sign In |