Re: pledge and unveil PHP wrappers don't work on current

2022-03-04 Thread Stuart Henderson
On 2022/03/04 22:28, i...@tutanota.com wrote:
> I looked in /usr/local/share/doc/pkg-readmes/pecl81-pledge because I 
> suspected any related information would be there. Perhaps a minor mention 
> that it has to be enabled as an extension, plus the name of the extension 
> itself will be helpful?

Not going to do that. This is common to every PHP extension (either
the "core" extensions from the PHP port, or from PECL), repeating the
same thing for over 100 packages that provide PHP extensions for the
various versions is going to reduce the signal:noise ratio in
pkg-readmes and make it harder for users to find what they need



Re: pledge and unveil PHP wrappers don't work on current

2022-03-04 Thread Clemens Gößnitzer
March 4, 2022 4:44 AM, i...@tutanota.com wrote:

> I am running an OpenBSD current box with PHP 8.1 and wanted to try out the 
> pledge and unveil
> wrappers.
> 
> I have installed the pecl81-pledge-2.0.2p3 package and have restarted 
> php81_fpm and httpd.
> 
> When I use pledge or unveil I get:
> 
> Error: Call to undefined function unveil() in ...
> 
> From the documentation there isn't anything that should be setup, i.e. no 
> loading of this package
> as an extension.
> 
> Kind regards
> 
> -- 
> Sent with Tutanota, the secure & ad-free mailbox.


You have to load the extension as described in the php pkg-readme:

Extension modules
=
Many language features in php are provided by extensions, which come
in several classes.

See /usr/local/share/doc/pkg-readme/php-*

Additionally, you can check if the module was loaded by the phpinfo() function, 
which should give you an output of all the loaded modules.


Hope that helps!