Skip to content

Instantly share code, notes, and snippets.

@tvlooy
Last active June 3, 2019 14:24
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tvlooy/0e28e59178be86a5c12096abde6f4bb3 to your computer and use it in GitHub Desktop.
Use OpenBSD's pledge and unveil syscalls in PHP
# Note that this is for people that want to build it from source, using pecl
# This code is in official OpenBSD ports now https://marc.info/?l=openbsd-ports-cvs&m=154270973708561
pkg_add php-7.2.10
ln -s /usr/local/bin/php-7.2 /usr/local/bin/php
ln -s /usr/local/bin/phpize-7.2 /usr/local/bin/phpize
ln -s /usr/local/bin/php-config-7.2 /usr/local/bin/php-config
pkg_add autoconf-2.69p2
export AUTOCONF_VERSION=2.69
pkg_add pear
pecl download pledge
tar xzvf pledge-2.0.2.tgz
cd pledge-2.0.2
phpize
./configure
make install
php -dextension=pledge -m | grep pledge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment