Enabling permalinks disables custom page template

It is because of

'has_archive' => true

which instruct wordpress to look for an archive template for the CPT. If you have a page with the same slug (portfolio) it will never get to display it as everything gets priority over pages.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)