Fix WordPress plugin installation permission issue

Problem: When I try to install a plugin at WordPress, I hit an error: Installation failed: Download failed. Destination directory for file streaming does not exist or is not writable. This is due to some permission problem when the content folder. I was editing some files as a sudo su power user, but the install… Continue reading Fix WordPress plugin installation permission issue

Fix WordPress with all pages returning 404 not found

Problem: I encounter a weird problem in WordPress, where the homepage is able to load properly, but all the pages are failing to load. An error page display: Not Found The requested URL was not found on this server. However, since the files were migrated from the other server, all the pages should exist already.… Continue reading Fix WordPress with all pages returning 404 not found

Debug php code on browser

In javascript, you can console.log(‘whatever”) in your browser for troubleshooting. However, in php code, a little bit trick is required to do so. Here are the steps: function debug_to_console($data) { $output = $data; if (is_array($output)) $output = implode(‘,’, $output); echo “<script>console.log(‘Debug Objects: ” . $output . “‘ );</script>”;} 2. In the line that you need… Continue reading Debug php code on browser