Xử lý url trong php

Thông thường thì chúng ta vẫn có một số trường hợp cần xử lý đường dẫn url, thành một url mới. Không chứa params nào đó Qui trình thực hiện Bước 1: Xóa khoảng trắng $url= trim($url, ‘/’); Bước 2: Thêm schema if (!preg_match(‘#^http(s)?://#’, $url)) { $url = ‘http://’ . $url; } Bước 3: parse_url […]

Xem thêm

Một số lưu ý khi học docker

1. Foreground và background của docker https://viblo.asia/p/dockers-detached-mode-cho-nguoi-moi-bat-dau-6J3ZgggRZmB 2.Sự khác nhau giữa run, cmd, entrypoint https://techmaster.vn/posts/36513/su-khac-biet-giua-run-cmd-va-entrypoint-trong-dockerfile 3. Docker volumes 4. Docker network 5. Phân quyền sử dụng user trong docker https://viblo.asia/p/tai-sao-nen-chay-ung-dung-container-voi-non-root-user-jvEla3VNKkw https://helpex.vn/question/chay-ung-dung-ben-trong-docker-voi-tu-cach-la-nguoi-dung-khong-root-5cd15977ae03f636cc614a68 6. Tại sao apline không có bash sẵn có https://stackoverflow.com/questions/45638784/how-to-retain-docker-alpine-container-after-exit-is-used/51133128#51133128 7.Tối ưu docker image https://viblo.asia/p/toi-uu-docker-image-Eb85o9D4Z2G#_build-image-voi-buildkit-8 https://viblo.asia/p/docker-image-in-production-cau-chuyen-1gb-hay-100mb-LzD5dXyE5jY

Xem thêm

Cấu hình phpcs và phpcs-fixer cho sublime text 4

<?xml version=”1.0″?> <ruleset xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” name=”PHP_CodeSniffer” xsi:noNamespaceSchemaLocation=”phpcs.xsd”> <description>The coding standard for PHP_CodeSniffer itself.</description> <!– Base rule for phpcs –> <!– Include and Exclude –> <file>autoload.php</file> <file>bin</file> <file>scripts</file> <file>src</file> <file>tests</file> <exclude-pattern>*/src/Standards/*/Tests/*\.(inc|css|js)$</exclude-pattern> <exclude-pattern>*/tests/Core/*/*\.(inc|css|js)$</exclude-pattern> <arg name=”basepath” value=”.”/> <arg name=”colors”/> <arg name=”parallel” value=”75″/> <arg value=”np”/> <!– Don’t hide tokenizer exceptions –> <rule ref=”Internal.Tokenizer.Exception”> <type>error</type> </rule> <!– Include the whole PEAR […]

Xem thêm

Tìm hiểu về mod_security

https://docs.nginx.com/nginx-waf/admin-guide/nginx-plus-modsecurity-waf-installation-logging/ https://quantrimang.com/phat-hien-va-chong-xam-nhap-web-server-voi-mod-security-15314 https://viblo.asia/p/tich-hop-mod-security-cho-web-application-server-de-chong-lai-sql-injection-va-tan-cong-xss-bJzKmx6X59N

Xem thêm

Các loại firewall trên linux

Bài viết này sẽ liệt kê ra vài loại firewall trên linux để dễ hình dung, tiện chọn trong tương lai 1. Firewalld Đây là một trong những firewall đơn giản đi kèm với Centos, nó cho phép thiết lập các zone và services dựa vào đó để cấu hình các rule. Trang chủ: https://firewalld.org […]

Xem thêm

Tìm hiểu về CORS

1. CORS là gì CORS là một cơ chế cho phép nhiều tài nguyên khác nhau (fonts, Javascript, v.v…) của một trang web có thể được truy vấn từ domain khác với domain của trang đó. CORS là viết tắt của từ Cross-origin resource sharing. Tại sao cần CORS CORS được sinh ra là vì […]

Xem thêm

Cài đặt mysql/mariadb + phpmyadmin trên linux

Bài viết này sẽ hướng dẫn bạn cài đặt mysql hay mariadb trên sever linux: centos hay ubuntu. 1. MYSQL / MARIADB là gì Là một loại cơ sở dữ liệu phổ biến trên thị trường, mysql và mariadb là tương tự nhau, và có một vài đặc điểm kĩ thuật khác biệt. 2. Hướng […]

Xem thêm

Cấu hình VPS cài đặt strapi và .netcore

1. Chọn VPS Để build strapi cần một vps 2GB ram trở lên, TH nếu ko sẽ bị lỗi. Thường thì dẽ chọn ubuntu 20.04 để cài đặt cho dễ quản lý sudo apt-get update # Update 2. Cài đặt swap cho ubuntu Tiến hành cài đặt swap để khi trường hợp không đủ ram […]

Xem thêm