On 2024-05-17, Martijn van Duren <openbsd+m...@list.imperialat.at> wrote:
> On Thu, 2024-05-16 at 21:58 -0400, F Bax wrote:
>> I think I missed something simple? I installed 7.5 release in a VM. I then 
>> installed nginx and PHP 8.3.3; with pkg_add. I then ran these two commands:
>> # rcctl enable php83_fpm
>> # rcctl start php83_fpm
>> I found an issue with php system() function; so created this simple script 
>> which produces "HiThere"; why is the date not presented?
>> 
>> <?php
>>   echo 'Hi';
>>   system( 'date' );
>>   echo 'There';
>> ?>
>
> All the advise I've seen is horrible. chroot isn't enabled by default
> without a reason (php and security have a history).
> My first question would by why you need system() in the first place.
> If you need the date/time, just use
> https://www.php.net/manual/en/class.datetime.php. If it's just a proof
> of concept be more precise in what you want to achieve and see if
> there's a PHP library equivalent. If there's no reasonable way to
> achieve it (which I highly doubt) I advise to copy the required binary
> (and dependencies) into the chroot and make a memo to keep them up to
> date.

There's some information about this in PHP's pkg-readme file.

-- 
Please keep replies on the mailing list.

Reply via email to