- Add the following ARG to your Dockerfile
ARG YASD_VERSION=2c86a0c
- Add the build dependencies to the apt-get install section of your Dockerfile
apt-get install -y ... libboost-all-dev \
-
Remove
phpX.X-xdebug
as we are replacing it with YASD -
Add YASD build BEFORE cleanup (apt-get -y autoremove)
&& cd /tmp \
&& curl -L https://github.com/swoole/yasd/archive/$YASD_VERSION.tar.gz --output yasd.tar.gz \
&& mkdir yasd && tar xzf yasd.tar.gz -C yasd --strip-components 1 \
&& cd yasd \
&& phpize --clean \
&& phpize \
&& ./configure \
&& make clean \
&& make \
&& make install \
Add the following to your php.ini
[yasd]
zend_extension=yasd
yasd.open_extended_info=${YASD_OPEN_EXTENDED_INFO}
yasd.debug_mode=${YASD_MODE}
yasd.remote_host=${YASD_REMOTE_HOST}
yasd.remote_port=9003
Modify your docker-compose.yml
...
environment:
WWWUSER: '${WWWUSER}'
LARAVEL_SAIL: 1
YASD_MODE: '${SAIL_YASD_MODE:-off}'
YASD_OPEN_EXTENDED_INFO: '${SAIL_YASD_OPEN_EXTENDED_INFO:-0}'
YASD_REMOTE_HOST: '${SAIL_YASD_REMOTE_HOST:-host.docker.internal}'
...
Add the following to your .env(.example)
#SAIL_YASD_MODE=remote
#SAIL_YASD_OPEN_EXTENDED_INFO=1
Uncomment above lines to enable debugging.
- YASD doc does mention
php -e
option to be required. This does not work with octane soyasd.open_extended_info
is being used to enable it globally. This will reduce performance considerably but is required.