Welcome Guest, Not a member yet? Register   Sign In
correct use of GIT for projects with codeigniter
#1

Good morning,
I tried to search around the web, but I couldn't find a solution.
I tried many times, but I always end up with the same result. In one way or another, I always have errors.

I'll try to explain the situation:

I create a project in codeigniter via composer, I start creating controllers, models and views and I create several pages. everything works perfectly.

Via a GIT server, I commit and then push, thus synchronizing my project in the GIT server.

From another PC, I clone the git project and, without making any changes, I try to view it.

errors upon errors and problems.

from the second PC, if I create a new project and then launch: php spark serve, everything works. on the project cloned from GIT sometimes the php spark serve command doesn't even start.

At this point I start to doubt my method.
is there a procedure to follow to be able to use git with codeigniter correctly?

are there any files that I need to add or remove from .gitignore?

Thanks.
Reply
#2

after clone the project you have to download the dependencies using composer install/update.
@xxxx[{::::::::::::::::::::::::::::::::>
Reply
#3

What errors do you see? Do you save .env composer.lock? Maybe you have different environments.
Simple CI 4 project for beginners codeigniter-expenses ( topic )
Reply
#4

Hello,
the version is the same. always 4.5.5
when I clone from git, the env file is not present, but I get a new one.

The error I get now is this:
Undefined constant "CodeIgniter\Database\MySQLi\MYSQLI_STORE_RESULT"

The composer update or install command completes without any errors.
Reply
#5

Usually, the .env file is in the GIT's .ignore file...
Reply
#6

perfect,
following some of your advice I managed to solve it.
The problem I was having was due to some php libraries that were not loading in windows.

I restored the gitignore file and as soon as I cloned the project, I ran composer install.

doing this, everything works perfectly.

Thanks to everyone for the info and advice.
Reply
#7

(This post was last modified: 12-03-2024, 01:14 PM by FlavioSuar.)

Great you sorted it out!
The best practices recommend don't share the .env file on GitHub...
Reply
#8

yes, I read. Thanks for the advice.
I currently use a local GIT server, accessible only to our internal lan
Reply




Theme © iAndrew 2016 - Forum software by © MyBB