PHP

PHP Slim Framework

Jack Moon 2022. 6. 29. 09:24
$ sudo vi /etc/apache2/sites-available/000-default.conf 
<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /home/jack/slim
        <Directory /home/jack/slim>
          Options Indexes FollowSymLinks
          AllowOverride All
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error_slim.log
        CustomLog ${APACHE_LOG_DIR}/access_slim.log combined
</VirtualHost>
$ cd /home/jack/slim
$ composer require slim/slim
$ composer require slim/http
$ vi .htaccess
<IfModule mod_rewrite.c>
   <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>
    RewriteEngine On
    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]
    # Send Requests To Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

'PHP' 카테고리의 다른 글

PHP 5.3 Zend Guard Loader 설치  (0) 2020.07.10
PHP 5.1.6 => 5.3 업그레이드  (0) 2020.07.09
php 7.2 업그레이드  (0) 2018.08.23
좋은 글   (0) 2018.07.12
php 에서 헤더 이용하여 엑셀 출력시 문자형 바꾸기 숫자->문자  (0) 2018.02.28