This is a way to install and set up Nginx, MariaDB and PHP 8.1 (mode PHP-FPM), Certbot on Ubuntu 20.04.
$ sudo apt update
$ sudo apt install nginx -y
//php | |
if(isset($_FILES["upload"])){ | |
$ext = ".".end((explode(".", $_FILES["upload"]["name"]))); | |
$filename="test"; | |
$file_public_addr =yourlocaladdr.$filename.$ext; | |
$success=move_uploaded_file($_FILES["upload"]["tmp_name"],SYS_EXT.$file_public_addr); | |
if( $success){ | |
$json["uploaded"]=true; |
<?php | |
// Replace EMAIL/API_KEY/ZONE_ID with your details. | |
// Zone ID is on the dashboard for the domain in the bottom right. | |
// Api keys are generated from the account settings. You must give cache purge permissions | |
// Place this script on your webserver and point a Github Webhook at it, and you'll clear | |
// the Cloudflare cache every time you do a push to GH. | |
try { | |
$head = []; | |
$head[] = 'Content-Type: application/json'; |
function removeVietnameseTones(str) { | |
str = str.replace(/à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ/g,"a"); | |
str = str.replace(/è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ/g,"e"); | |
str = str.replace(/ì|í|ị|ỉ|ĩ/g,"i"); | |
str = str.replace(/ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ/g,"o"); | |
str = str.replace(/ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ/g,"u"); | |
str = str.replace(/ỳ|ý|ỵ|ỷ|ỹ/g,"y"); | |
str = str.replace(/đ/g,"d"); | |
str = str.replace(/À|Á|Ạ|Ả|Ã|Â|Ầ|Ấ|Ậ|Ẩ|Ẫ|Ă|Ằ|Ắ|Ặ|Ẳ|Ẵ/g, "A"); | |
str = str.replace(/È|É|Ẹ|Ẻ|Ẽ|Ê|Ề|Ế|Ệ|Ể|Ễ/g, "E"); |