SyntaxHighlighterがハイライトされない問題2(Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP.) | www.yoshiislandblog.net

SyntaxHighlighterがハイライトされない問題2(Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP.)

前回、インストールし直しで直らなかったので、ググってみると、同様の問題が多数ヒット

以下を参考に進めてみる

SyntaxHighlighterが正常に表示されない場合の対策

しかし、
「Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP.」
というエラーで進めない

しょうがないので、CLIで直接ファイルを編集する
(直接プラグインのファイル編集は推奨されないので、自己責任のもと、必ず事前のバックアップをお願いします)

$ cd /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/
$ sudo vim syntaxhighlighter/syntaxhighlighter.php
$ sudo diff syntaxhighlighter/syntaxhighlighter.php syntaxhighlighter/syntaxhighlighter.php.20190211
959,960c959
< 		//document.getElementsByTagName("head")[0].insertBefore( corecss, document.getElementById("syntaxhighlighteranchor") );
< 		document.getElementById("syntaxhighlighteranchor").parentNode.insertBefore( corecss, document.getElementById("syntaxhighlighteranchor") );
---
> 		document.getElementsByTagName("head")[0].insertBefore( corecss, document.getElementById("syntaxhighlighteranchor") );
975,976c974
< 		//document.getElementsByTagName("head")[0].insertBefore( themecss, document.getElementById("syntaxhighlighteranchor") );
< 		document.getElementById("syntaxhighlighteranchor").parentNode.insertBefore( themecss, document.getElementById("syntaxhighlighteranchor") );
---
> 		document.getElementsByTagName("head")[0].insertBefore( themecss, document.getElementById("syntaxhighlighteranchor") );

これで解決!!

%d bloggers like this: