Page MenuHomePhabricator

[tools/code-utils] Make check-vars.php script compliant with modern dl() behavior
Closed, DeclinedPublic

Description

Current behavior with a default php.ini file:

PHP Warning: dl(): Dynamically loaded extensions aren't enabled in /usr/home/dereckson/dev/mediawiki/mediawiki/tools/code-utils/check-vars.php on line 41

Expected behavior:

The script manages to load the extension.

Solutions:

  • In a BSD world -> #!/usr/bin/env php --d enable_dl=On
  • In a OS agnostic world -> relaunch the script with php --d enable_dl=On

Version: unspecified
Severity: trivial

Details

Reference
bz43779

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:30 AM
bzimport set Reference to bz43779.

[ Moved to correct component. ]

dl() should be enabled by default according to http://fr2.php.net/manual/en/info.configuration.php#ini.enable-dl . Though it is disabled when using safe_mode which is removed in 5.4.

I don't think we need a workaround, you should fix up your php.ini to allow dl() :-D

There are two levels of PHP default configurations:

  • The PHP core default values (true)
  • The default values set in the PHP configuration files shipped in the official releases. Both php.ini-production and php.ini-development contain enable_dl = Off.

These files are wildly in use everywhere others than in the shared hosting world and provide a reliable set of default values.

I'm sorry you thought I were confusing a support request with a bug report: MY php.ini DOES allow dl, I were checking portability issues on scripts to maximize compatibility. If you read again the bug report, you'll note the explicit mention to these files: "with a default php.ini file".

For reference:

Oh, and git blame is telling me that were already like that in 2009.

(In reply to Dereckson from comment #1)

Gerrit change #42952.

Patch abandoned in Gerrit, hence resetting bug status.

Dereckson, do you still plan to work on this?