View Issue Details

IDProjectCategoryView StatusLast Update
0000756PHP for OS/2, ArcaOS & eComStation (PHP versions v8.x v7.x v5.x)Feature Requestpublic2022-05-18 18:01
ReporterSteven Levine Assigned ToSteven Levine  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformOS2/eCSOSOS/2 or eComstationOS Version1.x 2.x or 4.5
Fixed in Version8.1.6 
Summary0000756: Avoid need to add the php extensions directory to LIBPATH or BEGINLIBPATH.
Descriptionphp requires that extensions directories must be in LIBPATH, BEGINLIBPATH or ENDLIBPATH or the extensions will fail to load. A typical solution is that add the extensions directory to BEGINLIBPATH before starting httpd or php.
Adding the directory to the LIBPATH, can work but if there is a need to work with multiple php installations.

The proposed solution is to modify ext\standard\dl.c so that if the extension directory is not already in BEGINLIBPATH, invoke DosSetExtLIBPATH to add the directory.
TagsNo tags attached.

Activities

Steven Levine

2022-05-11 23:59

manager   ~0004226

This feature will be implemented by https://github.com/psmedley/php-7-os2/pulls and friends.

psmedley

2022-05-13 09:15

administrator   ~0004229

https://smedley.id.au/tmp/php-7.4.28-os2-20220513.zip has this PR included. I forgot to modify makefile for debug, so debug symbols will have to wait :/

psmedley

2022-05-13 09:58

administrator   ~0004230

https://smedley.id.au/tmp/php-7.4.28-os2-debug-20220513.zip should be a debug build :)

Steven Levine

2022-05-13 20:14

manager   ~0004233

This looks good.

>set BEGINLIBPATH
Not in environment "BEGINLIBPATH"

d:\internet\php7
>php -c. -f mysql_shl.php

Notice: PHP Startup: update_beginlibpath set BEGINLIBPATH to modules\;%BEGINLIBPATH% in Unknown on line 0
Connected successfully
Select returned 271 rows

.\php.ini, which is set up for local testing, contains

extension_dir = "modules/"

d:\internet\php7

>php -f mysql_shl.php

Notice: PHP Startup: update_beginlibpath set BEGINLIBPATH to d:\internet\php7\modules\;%BEGINLIBPATH% in Unknown on line 0
Connected successfully
Select returned 271 rows

The production php.ini contains:

extension_dir = "d:/internet/php7/modules/"

Let me know if anything shows up in your testing.

Steven Levine

2022-05-13 20:29

manager   ~0004235

This patch does not avoid the need for BEGINLIBPATH when php is invoked via modphp7.dll which statically links to php7.dll. I'm not sure yet what a generic should might look like. It will probably take a new httpd directive.

Steven Levine

2022-05-13 20:49

manager   ~0004236

I'm thinking that OS2LibPath would be a good name for the directive. I have to figure out where the code should live. Probably mod_so.c, along with the other BEGINLIBPATH patches.

psmedley

2022-05-13 21:11

administrator   ~0004238

I plan to try and test today,I've been focussing on getting the php-8.1 branch building, and merged to the 8.1.6 code :)

Steven Levine

2022-05-18 18:01

manager   ~0004316

Implemented for both 7.4.28 and 8.1.6.

Will need additional BEGINLIBPATH support in httpd to allow modphp.dll to find and load php.dll. This will a separate ticket.

Issue History

Date Modified Username Field Change
2022-05-10 03:53 Steven Levine New Issue
2022-05-10 03:53 Steven Levine Status new => assigned
2022-05-10 03:53 Steven Levine Assigned To => Steven Levine
2022-05-11 23:59 Steven Levine Note Added: 0004226
2022-05-13 09:15 psmedley Note Added: 0004229
2022-05-13 09:58 psmedley Note Added: 0004230
2022-05-13 20:14 Steven Levine Note Added: 0004233
2022-05-13 20:29 Steven Levine Note Added: 0004235
2022-05-13 20:49 Steven Levine Note Added: 0004236
2022-05-13 21:11 psmedley Note Added: 0004238
2022-05-18 18:01 Steven Levine Status assigned => resolved
2022-05-18 18:01 Steven Levine Resolution open => fixed
2022-05-18 18:01 Steven Levine Fixed in Version => 8.1.6
2022-05-18 18:01 Steven Levine Note Added: 0004316