What plugin are you using to handle Latex?
Error: Cannot create dvi file
This is likely because WP does not have adequate permissions to create a file at the intended location. Determine where this file creation is being attempted. You may need to ask the plugin’s devs if you cannot determine this on your own.
You’ll also need to know what user PHP and WP runs as. A server user, not WP user. You may need to ask your host for this information.
Via FTP or hosting file manager, check the permissions for the directory where the file creation should occur. If the directory is owned by the PHP user, 755 should be adequate permission. If the PHP user is not the owner, 775 will be necessary and the PHP user will need to belong to the group that has change permission.
Also check if there is a .htaccess file in the directory, or any ancestor directory. It could have a directive that prevents creation of files.
Error: Cannot create dvi file
This is likely because WP does not have adequate permissions to create a file at the intended location.
OP is using the WP QuickLaTeX plugin, which hasn’t seen any recent updates and support forum posts aren’t getting any answers.
A similar issue was raised over 2 years ago, and the culprit at the time was maintenance work on the QuickLatex.com server: https://ww.wp.xz.cn/support/topic/cannot-create-dvi-file/
Also, the online renderer on the homepage of QuickLatex.com returned the exact same error message when I put in OP’s (perfectly fine) LaTeX code \phi_{\mathrm{P}} = \arg\left( \langle \psi_1 \mid \psi_2 \rangle \right).
So the culprit here seems to be the backend service at QuickLatex.com, which the WP QuickLaTeX plugin depends on.
Thank you very much to all for your help and hints!!!
Heh, it never occurred to me that the inability to create a file would be about a remote server. If that’s the case, I’m afraid correcting QuickLatex errors may be a lost cause considering the plugin is no longer supported. You’ll likely need to find an alternative solution such as KaTex. This plugin at least has been recently updated even though the support forum has not seen any recent activity. Even if the WP plugin should also eventually become orphaned, the KaTex project itself will likely live on as an open source GitHub project. There should always be a way to integrate KaTex into your site yourself with some custom coding.
Disclaimer: I’ve no personal experience with KaTex. I only happened upon it almost by accident and thought it looked like a good open source project.