Install php7.2 instead of php5.4 on Amazon Linux 2

Problem: When you start a new Amazon Linux 2 AMI server, and try to install php via command: After install successfully and check the version, you would see php -v PHP 5.4.16 (cli) (built: Oct 31 2019 18:34:05) However, the latest php version is 7.2 and you want to have a new version. Solution: You… Continue reading Install php7.2 instead of php5.4 on Amazon Linux 2

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