IT/PHP

[Laravel] There is no existing directory at "blah blah" and its not buildable:Permission denied 접근권한 문제

월공 2020. 7. 27. 07:56
728x90
300x250

세상에 모든 버그는 다 겪는 월공 티스토리에 환영합니다(?)

구글링 해보니 storage에 접근권한이 없다고한다

웹서버가 접근을 해야하는데 권한이 없으면 접근을 못해서 이러한 에러가 난다고 한다.

755 로 해주는건 둘째치고 우선 웹서버에게 권한을 줘야하는거같다.

굳이 755로 안해도 웹서버에 접근권한만 주면 해결되는듯 ?

센토스라서 일반적으로 nginx 나 apache 계정을 사용한다고한다

난 apache 로 부여했다.

chown -R apache:apache storage bootstrap/cache

chmod -R 755 /var/www/html/laravel/storage

 

linux putty 에서 위 블럭 두번째 명령어를 실행하거나

파일질라에서 바꿔도 된다 바꾸고나면

 

아래처럼 접속했을때 이상없이 잘되는걸 확인할수있다

 

 

참고로 아파치 httpd.conf 에 라라벨 실행 경로세팅을

라라벨 폴더 내부에 public 으로 향해야한다는걸 이제알았다 ㅎㅎ

<VirtualHost *:80>
    DocumentRoot /var/www/html/laravel/public
    ServerName example.com
    ErrorLog logs/laravel-error_log   
    CustomLog logs/laravel-access_log common
</VirtualHost>

 

728x90
300x250