Note
If your using macOS Monterey or below, please refer to How to install OCI8 on macOS (Monterey) M1 Processor with PHP 8.1
macOS Ventura and above, duplicating and renaming Terminal.app are disabled by Apple. In order to install the OCI8, we need to switch between arm64 and x86_64 architecture.
In Terminal, there is no automatic detection for missing Rosetta to run older architecture command line tools.