# |
Jan 9th 2020, 09:41 |
slackebot |
www.DeepL.com/Translator (free version) |
# |
Jan 9th 2020, 09:41 |
y.skrzypczyk |
Good morning, everyone, I'm looking for some help on cakephp, I'm asked to debug a solution developed by a bad developer who hasn't done any documentation. I have the vague impression that even files are missing in the project and the repository has only one commit. In short not mastering the framework there is some knowledge that I miss. Is there a kind soul to give me some leads ? Thanks in advance. Translated with |
# |
Jan 9th 2020, 09:41 |
neon1024 |
You can also set env vars in your server config, so if you have multiple servers you can apply config to each |
# |
Jan 9th 2020, 09:40 |
damiano |
thanks |
# |
Jan 9th 2020, 09:40 |
damiano |
ok got it |
# |
Jan 9th 2020, 09:40 |
neon1024 |
Plus it means you can run dev env vars and live ones and properly manage your environments without having to edit app.php each time |
# |
Jan 9th 2020, 09:39 |
neon1024 |
Using env abstracts that away |
# |
Jan 9th 2020, 09:39 |
neon1024 |
So if you changed it every time you deployed it would collide with Git changes |
# |
Jan 9th 2020, 09:39 |
neon1024 |
It gets copied from the default |
# |
Jan 9th 2020, 09:39 |
damiano |
i am using cakephp/app skeleton |
# |
Jan 9th 2020, 09:39 |
damiano |
i do not see app.php in gitignore |
# |
Jan 9th 2020, 09:38 |
neon1024 |
You do not version `app.php` |
# |
Jan 9th 2020, 09:38 |
damiano |
@neon1024 pardon i miss one thing...what the point of putting env variables inside /config/.env then writing them to app.php directly ? |
# |
Jan 9th 2020, 09:32 |
neon1024 |
https://book.cakephp.org/3/en/development/configuration.html#environment-variables |
# |
Jan 9th 2020, 09:31 |
neon1024 |
It sounds like your question is “How do I use the environment variables?” |
# |
Jan 9th 2020, 09:30 |
damiano |
config/.env ? |
# |
Jan 9th 2020, 09:30 |
damiano |
how can i read the configuration should i write settings there (in the file) or in env vars? |
# |
Jan 9th 2020, 09:30 |
damiano |
yes but i need app.php when i deploy the application |
# |
Jan 9th 2020, 09:29 |
challgren |
I think it's best to leave the app.php file alone and use app_local.php |
# |
Jan 9th 2020, 09:28 |
damiano |
@challgren yes i mean for deploy |
# |
Jan 9th 2020, 09:28 |
challgren |
In 4 it might be in the app_local.php |
# |
Jan 9th 2020, 09:27 |
neon1024 |
Totally up to you, we do it one way in some projects, and the other way in others |
# |
Jan 9th 2020, 09:26 |
damiano |
should i add them in app.php directly or in env var? |
# |
Jan 9th 2020, 09:26 |
damiano |
@neon1024 i know i can pass the value there...but i am asking what is the best way to organize them after deploy |
# |
Jan 9th 2020, 09:25 |
neon1024 |
Check the second param of the `env()` function |
# |
Jan 9th 2020, 09:25 |
damiano |
i only see this |
# |
Jan 9th 2020, 09:25 |
damiano |
'Security' => [ 'salt' => env('SECURITY_SALT'), ], |
# |
Jan 9th 2020, 09:25 |
damiano |
@conehead not in cakephp 4 |
# |
Jan 9th 2020, 09:18 |
conehead |
@damiano app.php does have a Security.salt. It tries to read from env but if it does not exist, it will take the default value |
# |
Jan 9th 2020, 09:17 |
ciby48719 |
simple php file working in that folder. But adding the cakephp project in that folder showing as ' Forbidden Issue'. That is i am asking any permission issue for the project files |
# |
Jan 9th 2020, 09:15 |
damiano |
hello, i have seen that app.php doe snot have the Security.salt but it reads from env() what is the best wait to create and organize envirorment variables? |
# |
Jan 9th 2020, 09:05 |
neon1024 |
Morning all :wave: |
# |
Jan 9th 2020, 09:04 |
conehead |
ciby but it is working with a simple php file? you checked that first? |
# |
Jan 9th 2020, 07:19 |
ciby48719 |
will check the permission for the folders |
# |
Jan 9th 2020, 07:19 |
ciby48719 |
but its not reflected |
# |
Jan 9th 2020, 07:19 |
ciby48719 |
changed the' Require local' option |
# |
Jan 9th 2020, 07:14 |
jotpe |
ciby48719 I'm not on Windows but I guess your folder permissions are not set correct right. Try to search for what is the http user of the wamp stack and change your cakephp app to that user. I remember there was also a option `Require local` to change in the http config but I don't remember exactly. |
# |
Jan 9th 2020, 07:07 |
jotpe |
Morning |
# |
Jan 9th 2020, 06:19 |
ciby48719 |
how can we resolve this issue. I checked the httpd-vhosts.conf file and done some changes show in online links .But its not working |
# |
Jan 9th 2020, 06:18 |
ciby48719 |
after taking the localhost url in browser showing as 'Forbidden you don't have permission to access this resource' |
# |
Jan 9th 2020, 06:17 |
ciby48719 |
set up the project in localhost, Changed the root and webroot htaccess file |