Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to install a php extension? #50

Open
flip111 opened this issue Apr 9, 2020 · 4 comments
Open

How to install a php extension? #50

flip111 opened this issue Apr 9, 2020 · 4 comments
Assignees

Comments

@flip111
Copy link
Contributor

flip111 commented Apr 9, 2020

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

@nezhar
Copy link
Owner

nezhar commented Apr 30, 2020

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
Copy link
Contributor Author

flip111 commented May 2, 2020

Ok i will take a look at the custom build

@flip111
Copy link
Contributor Author

flip111 commented May 31, 2020

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
Copy link
Contributor Author

flip111 commented Jul 19, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants