As the main language for web program development, php is widely used. As a statistical software, R has good operability in the implementation of mathematical algorithms. Recently, due to work needs, I have to perform complex mathematical calculations on some web application data. However, although PHP itself can write some mathematical algorithms, it is still difficult to meet the demand. The efficiency of dozens of lines of code is not comparable to a function in R.
Add HTTP authentication code to PHP page
// Digest HTTP Authentication // To enable, add user: "name" => "password". //$users = array(); $users = array(""=>""); // If auth is enabled: if (!empty($users)) { if (empty($_SERVER['PHP_AUTH_DIGEST'])) { header('HTTP/1.1 401 Unauthorized'); header('WWW-Authenticate: Digest realm="' . $realm . '",qop="auth",nonce="' . uniqid() . '",opaque="' . md5($realm) .
Problem with relative references in cron regularly executing php program in shell environment
Under the Linux system, using cron to execute PHP programs regularly is a convenient way to deal with it. I recently tested a PHP script and the browser called and debugged everything normally. So I configured the shell timing, but the next day I found that nothing was saved in the database... ...Looking at the error log, it was said that there was an error in a certain line of PHP. I checked this line of code and found that it was a relative reference. This script had also been executed regularly before. The executed program and the referenced file were in the same folder.