php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4562 Can't load library with dl()
Submitted: 2000-05-23 13:39 UTC Modified: 2000-09-04 19:33 UTC
From: konon at relex dot ru Assigned:
Status: Closed Package: Dynamic loading
PHP Version: 4.0.0 Release OS: WindowsNT 4.0
Private report: No CVE-ID: None
 [2000-05-23 13:39 UTC] konon at relex dot ru
When I call a simple script
<?
dl("mylib.dll");
?>
I received:
----
Warning: PHP Linter SQL Server extension: Unable to initialize module
Module compiled with debug=46, thread-safety=49 module API=0
PHP compiled with debug=0, thread-safety=1 module API=20000401 These options need to match in Unknown on line 0
----
My library has been built with new php header files(php 4.0.0) and 1-byte struct alignment

As I think the problem is with alignment
The tail of zend_module_entry is :
	int module_number;
	unsigned char zend_debug;
	unsigned char zts;
	unsigned int zend_api;

and if php4ts.dll is compiled with 4-byte alignment we'll have this problem

May be better to use such tail:
	int module_number;
	unsigned short zend_debug;
	unsigned short zts;
	unsigned int zend_api;
or
	int module_number;
	unsigned char zend_debug;
	unsigned char zts;
        unsigned char rez[2];
	unsigned int zend_api;

??






Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-20 03:38 UTC] sniper@php.net
Does this problem still persist with more recent version of php (from CVS or http://snaps.php.net) ??

--Jani
 [2000-09-04 19:33 UTC] sniper@php.net
No feedback. Please try php4.0.2 or latest CVS or snapshot from
http://snaps.php.net/ and reopen this bug report if problem still exists.

--Jani
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 20:01:29 2024 UTC