nezhar/wordpress-docker-compose

How to install a php extension?

flip111 opened this issue · 4 comments

I would like to use intl to use some locale functions in php

I was thinking about this for a while, to make it more accessible, but also not making the build more complicated when someone needs a specific version of WordPress. Would you like to take a look at #57?

Ok i will take a look at the custom build

With patch of custom build i can enable a php extension. I didn't try to install one though (that is making the .so file available)

Steps to install xdebug with tracing.

  1. make sure the container is not running
  2. mkdir traces in the root of this project (not in the wordpress root).
  3. Add in docker-compose.yml under volumes of the wp container: - ./traces:/home/traces
  4. run the container, it will now be rebuilded because you changed the docker-compose.yml file, any changes you make after this will be lost when changing it again.
  5. docker ps, copy the container ID which uses image wordpress:latest
  6. docker exec -it container_id_here /bin/bash
  7. By default the official wordpress container does not load a configuration file for php. The setup of this project together with xdebug is for development, therefor lets use the default php-development.ini file as a base for a new php.ini file: cp /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini
  8. cd ~
  9. php -i, copy the output text into https://xdebug.org/wizard
  10. follow instructions on the xdebug page, the tgz file can be downloaded like this curl -O -J http://xdebug.org/files/xdebug-2.9.6.tgz. You need to enter text into a file, you can use nano apt update && apt install nano
  11. Add for tracing the following line to the php.ini configuration and then restart the container:
xdebug.auto_trace = true
xdebug.collect_params = 4
xdebug.trace_format = 0
xdebug.collect_return = true
xdebug.collect_assignments = true
xdebug.trace_output_dir = /root/traces
xdebug.trace_output_name = trace.%u

NOTE: work in progress, traces don't always show up