nextcloud 업그레이드 할 때 php 버전 문제

nextcloud를 오랜만에 업그레이드 하려는데 아래와 같은 오류가 발생했다. 최소한 php 7.1 버전을 사용해야 한다고 메시지가 나왔다.

You are currently running PHP 7.0.33-0+deb9u3. Upgrade your PHP version to take advantage of performance and security updates provided by the PHP Group as soon as your distribution supports it.
Please double check the installation guides ↗, and check for any errors or warnings in the log.

ubuntu에서 php 7.2를 설치하고 nginx를 restart 했는데 여전히 php 7.0으로 나왔다. 문제가 뭐인가 하니 nginx의 configuration에서 php 버전을 명시해야한다.

nextcloud를 위해 만들어둔 config에 다음 내용을 추가한다.

fastcgi_pass unix:/run/php/php7.2-fpm.sock;

대략 아래와 같다.

location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) {
    fastcgi_split_path_info ^(.+\.php)(/.*)$;
    include fastcgi_params;
    fastcgi_pass unix:/run/php/php7.2-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    fastcgi_param modHeadersAvailable true;
    fastcgi_param front_controller_active true;
    fastcgi_intercept_errors on;
    fastcgi_request_buffering off;
}

참고

Leave a Reply