Skip to content

Instantly share code, notes, and snippets.

@lokisho
lokisho / pthreads_howto.md
Last active May 24, 2022 01:49
How to install multithreads (pthreads) for php 7.3 ubuntu 18.04

Tutorial

pthreads allows to use multiple threads when running a php script with php cli.

Important: it only works for php cli, not in a web browser
The reasons for that can be found in the article recommended in Acknowledgments and resources section.
We are following 3 steps.
  • Install php7.3 as usual for our web server applications (if you pretend to use only php cli in your server, you can skip this step).
@lokisho
lokisho / Docker commands
Last active March 10, 2020 04:25
Docker commands
docker container run --publish[allow to listen] 8080:80[host_port:container_port] --name[optional for listing] webhost -d[detached] nginx:1.11[optional image version] nginx [image]
--env [to pass environment variables]
docker container logs [to view the logs of the container, useful to get mysql password for example]
docker container stop NAME [stops container, space separated to stop multiple containers]
docker container ls [list containers] -a [all]
docker container top [process list in one container]
docker container inspect <name|id>[details of one container config]
docker container stats [performance stats for all containers]
docker container exec -it [run additional command in existing container]
docker container run -it [run additional command in existing container] ex docker container run -it nginx bash[to get the bash command]