How to export mysql or mariadb data from docker

List running dockers that running with mysql or mariadb juzhax@Justins-MacBook-Air ~ % docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 7e49a319857c mariadb “docker-entrypoint.s…” 24 hours ago Up 21 minutes 0.0.0.0:54482->3306/tcp wp-env-mysql-1 Access CLI to mariadb container docker exec -it 7e49a319857c /bin/bash Dump data using mysqldump mysqldump -uroot -p wordpress > /tmp/wordpress.sql Then exit the CLI. Copy the data from docker out docker cp 7e49a319857c:/tmp/wordpr[…]

How to export mysql or mariadb data from docker Read More »

Usage of wp_add_inline_style and wp_add_inline_script in WordPress

3 regular usages of wp_add_inline_style and wp_add_inline_script Add CSS Style without dependency wp_register_style( ‘wp-juzhax-css’, false ); wp_enqueue_style( ‘wp-juzhax-css’ ); wp_add_inline_style( ‘wp-juzhax-css’, “body *{ box-sizing: inherit; }”); Add JavaScript Code without dependency wp_register_script( ‘wp-juzhax-js-header’, ”,); wp_enqueue_script( ‘wp-juzhax-js-header’ ); wp_add_inline_script( wp-juzhax-js-header’, “console.log(‘loaded in header’);”); Add JavaScript Code with jQuery de[…]

Usage of wp_add_inline_style and wp_add_inline_script in WordPress Read More »

/user.slice/user-1000.slice/session-2145.scope is not a snap cgroup

Chromium Browser in Ubuntu Recently, I need to use headless Chromium Browser to running bot for some purpose, but it is not smooth as the documentation says. Error while using headless Chrome $ /usr/bin/chromium-browser –help /user.slice/user-1000.slice/session-2145.scope is not a snap cgroup Installing dbus-user-session # sudo apt-get install dbus-user-session Reading package lists… Done Building dependency tree… Done Reading state information… Done dbus-user-session is already the newes[…]

/user.slice/user-1000.slice/session-2145.scope is not a snap cgroup Read More »

How to modify docker php.ini without installing editor

Editor Not found Recently I would like edit the php.ini in Bitnami WordPress Docker using CLI, but inside the docker doesn’t contain any editor and apt-get is not allowed me to install any editor. $ vim /bin/sh: 1: vim: not found $ vi /bin/sh: 2: vi: not found $ nano /bin/sh: 3: nano: not found $ Modify the upload limit for PHP I want to upload a file more than 800M, I’ve to apply these to php.ini upload_max_filesize 1000M post_max_size 1000M memory_limit 1000M max_execution_time 0 max_input_tim[…]

How to modify docker php.ini without installing editor Read More »

Installing Bitnami WordPress Nginx into Apple m1

Preparing Folders Prepare the a project folders that put your mariadb data and Wordpress files data. # cd ~ # mkdir wp # cd wp # mkdir mariadb # mkdir wordpress The folders we need /Users/juzhax/wp /Users/juzhax/wp/mariadb /Users/juzhax/wp/wordpress Preparing the Docker Compose file touch /Users/juzhax/wp/docker-compose.yml Insert the data using your favorite editor. I like to use vim vim /Users/juzhax/wp/docker-compose.yml version: ‘2’ services: mariadb: image: docker.io/bitnami/mariadb:10.6 vo[…]

Installing Bitnami WordPress Nginx into Apple m1 Read More »

Operation not supported: AH00023: Couldn’t create the mpm-accept mutex

Starting up Recently I install the Bitnami WordPress on Apple MacBook Air M1, after WordPress setup finished, the error appeared after the Starting Apache The Errors (95)Operation not supported: AH00023: Couldn’t create the mpm-accept mutex (95)Operation not supported: could not create accept mutex The fixes Using a Dockerfile with the contents: FROM bitnami/moodle # Some credit goes to: https://www.linode.com/community/questions/16977/server-fails-after-installing-certbot-mpm-run-failed-exiting[…]

Operation not supported: AH00023: Couldn’t create the mpm-accept mutex Read More »

WARNING: The requested image’s platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

Installing Recently I install the Bitnami WordPress for Docker on Apple MacOS with M1 Chip. I followed the documentation from the official Bitnami Wordpress Example console command docker run -d –name wordpress \ -p 8080:8080 -p 8443:8443 \ –env ALLOW_EMPTY_PASSWORD=yes \ –env WORDPRESS_DATABASE_USER=bn_wordpress \ –env WORDPRESS_DATABASE_PASSWORD=bitnami \ –env WORDPRESS_DATABASE_NAME=bitnami_wordpress \ –network wordpress-network \ –volume wordpress_data:/bitnami/wordpress \ bitnami/wor[…]

WARNING: The requested image’s platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested Read More »

Safely inject the values into SQL

Other than using bind in SQL, this is the old school way to solve the SQL query to prevent injection attack Sample Code // a sample list of values to use in IN(): $values = [1,4,10,’12a’,’xy\’z’]; // VERSION 1. For integers: make sure all array elements are integers $in = implode(‘,’, array_map(‘intval’, $values)); // VERSION 2. For strings: apply PDO::quote() function to all elements $in = implode(‘,’, array_map([$pdo, ‘quote’], $values)); // VERSION 3. Custom sanitization: allow only letters a[…]

Safely inject the values into SQL Read More »

Installing PHP Extension in WP ENV

I need pdo_mysql php extension to use on my Wordpress plugins. After a day of research, I found out that this is the limitation of wp-env. The developers do not want us to touch more to any setting of PHP and Docker. So we have to manually install everytime after wp-env start. You can use this way to install other php extensions. Install pdo_mysql after WP-ENV started. wp-env start docker ps docker exec -it [WORDPRESS_CONTAINER_ID] docker-php-ext-install pdo_mysql docker exec -it [WORDPRESS_CONT[…]

Installing PHP Extension in WP ENV Read More »