php / php/php-src

`zend_extension` php.ini uses different path discovery than `extension`

Open
#9,893 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Status: Needs Triage
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

Description

Steps to reproduce:

File structure:

  • ./ - current directory
  • ./php-8.1.12-nts-Win32-vs16-x64 - extracted from official Windows download
  • ./php-8.1.12-nts-Win32-vs16-x64\ext\php_xdebug.dll - downloaded from official xdebug website

When I run .\php-8.1.12-nts-Win32-vs16-x64\php.exe -d xdebug.mode=coverage -d extension=ext/php_xdebug test.php I get:

Warning: Xdebug MUST be loaded as a Zend extension in Unknown on line 0
... (xdebug is working, output from test.php code)

When I run .\php-8.1.12-nts-Win32-vs16-x64\php.exe -d xdebug.mode=coverage -d zend_extension=ext/php_xdebug.dll test.php I get:

Warning: Failed loading Zend extension 'ext/php_xdebug.dll' (tried: C:\php\ext\ext/php_xdebug.dll (The specified module could not be found), C:\php\ext\php_ext/php_xdebug.dll.dll (The specified module could not be found)) in Unknown on line 0

Fatal error: Uncaught Error: Call to undefined function xdebug_start_code_coverage() in C:\Users\mvorisek\Desktop\forks\cov-php81-debug\test.php:5
Stack trace:
#0 {main}
  thrown in C:\Users\mvorisek\Desktop\forks\cov-php81-debug\test.php on line 5

I would expect exactly the same extension discovery for extension and zend_extension.

(and I can confirm zend_extension with absolute php_xdebug.dll path is working)

PHP Version

PHP 8.1.12 NTS Win x64

Operating System

Windows 10

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two Windows command lines against the PHP 8.1.12 NTS build and compare relative-path handling for extension and zend_extension. Trace the extension-loading entry points and their path resolution behavior; done means both directives discover the same relative DLL path without changing absolute-path behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, php
Domain
backend, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.