2022.02.22 - [취업/CodeIgniter] - [ci4] 최소지원 php 버전은 7.2? 7.3?
[ci4] 최소지원 php 버전은 7.2? 7.3?
회사에선 ci4이지만, php 버전 7.2를 쓰는데, ci4에선 다운로드에선 최소 지원이 7.3버전이더라 https://codeigniter.com/download Welcome to CodeIgniter CodeIgniter 4 is the latest version of the framework, intended for use with PHP
kasumil.tistory.com
해당 내용을 통해서 다운 받으면 되고, 내 경우에 7.2를 사용하기에 해당 부분의 내용대로 수정하였다.
public폴더가 연결이 안되서 이걸 어떻게 하나 했는데,
aws의 라우팅 방식이 여러가지 있다는 것을 알게되었다는 점...? - 이건 알고 싶지 않았지만.
고장 난 부위를 파악하는데 있어 라우팅방식이 어떠냐에 따라 다르니까... ㅠ
문제점.
1. 해당 페이지 접속시 www가 자동 단축 url로 바뀌는 문제.
2. ci4 접근 안되는 문제.
1번 문제의 경우
# Line 24
# Rewrite "www.example.com -> example.com"
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ https://www.%1%{REQUEST_URI} [R=301,L]
위와 같이 변경하니 해당 문제 해결.
2번 문제는 발생 지점을 찾는 게 문제라서
문제점을 찾기 위해서 문제 발생지를 분리했다.
aws - apache2 - ci4
처음에는 경로문제인가 했는데, 도메인 주소에 /path값으로 index.php로 기입하니 정상적으로 호출되더라.
이 상태에서 aws에서 접근시 http -> https로 자동 리다이렉션되게 만들어놨는데, 그부분이 작동되는 것을 알고,
aws, apache2 문제는 아니라고 생각했다.
역시나 ci4의 public/.htaccess 파일의 문제.
해당 부분에서 ci4의 로그를 볼 필요가 있었다.
writable/logs의 기록을 보니 class 이름이 Kint로 되어 있는데, 파일명이 kint.php로 된 문제였다.
ci4 project\system\ThirdParty\Kint로 접근해서 kint -> Kint로 변경
https://herendthere.tistory.com/3
Codeigniter4 에서 Class Kint Not Found 오류 해결
로컬 개발환경에서 개발을 진행할 때 오류가 없었는데 리눅스에 소스를 업로드하니 `Class 'Kint\Kint' not found` 오류가 발생했다. 해결 방법 아래 경로로 이동하여 system\ThirdParty\Kint kint.php 파일의 앞
herendthere.tistory.com
- ci4 오류 로그 볼때 참조 -
http://ci4doc.cikorea.net/installation/troubleshooting.html#id11
문제 해결 — CodeIgniter 4.2.10 documentation
© Copyright 2019-2022 CodeIgniter Foundation. Last updated on Nov 07, 2022.
ci4doc.cikorea.net
.htaccess 파일 전문
# Disable directory browsing
Options All -Indexes
# ----------------------------------------------------------------------
# Rewrite engine
# ----------------------------------------------------------------------
# Turning on the rewrite engine is necessary for the following rules and features.
# FollowSymLinks must be enabled for this to work.
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
# If you installed CodeIgniter in a subfolder, you will need to
# change the following line to match the subfolder you need.
# http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase
# RewriteBase /
# Redirect Trailing Slashes...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Rewrite "www.example.com -> example.com"
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ https://www.%1%{REQUEST_URI} [R=301,L]
# Checks to see if the user is attempting to access a valid file,
# such as an image or css document, if this isn't true it sends the
# request to the front controller, index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([\s\S]*)$ index.php/$1 [L,NC,QSA]
# Ensure Authorization header is passed along
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
ErrorDocument 404 index.php
</IfModule>
# Disable server signature start
ServerSignature Off
# Disable server signature end
'취업 > CodeIgniter' 카테고리의 다른 글
[CI4] Jquery sortable 적용하기 (1) | 2022.12.30 |
---|---|
[CI4] 다날 API PHP 연동작업 후기 (0) | 2022.12.18 |
[CI4] 스텝바 코드 CSS (0) | 2022.10.25 |
[CI4] 브라우저 모바일/PC 페이지 속도 최적화. (0) | 2022.10.23 |
[ci4] 프로그레스바 툴팁 추가하기 (1) | 2022.10.11 |