How to install a php extension?
flip111 opened this issue · 4 comments
flip111 commented
I would like to use intl
to use some locale functions in php
nezhar commented
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?
flip111 commented
Ok i will take a look at the custom build
flip111 commented
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)
flip111 commented
Steps to install xdebug with tracing.
- make sure the container is not running
mkdir traces
in the root of this project (not in the wordpress root).- Add in
docker-compose.yml
undervolumes
of thewp
container:- ./traces:/home/traces
- 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. docker ps
, copy the container ID which uses imagewordpress:latest
docker exec -it container_id_here /bin/bash
- 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 newphp.ini
file:cp /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini
cd ~
php -i
, copy the output text into https://xdebug.org/wizard- 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 nanoapt update && apt install nano
- 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