|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-03-30 07:57 UTC] sas at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 09:00:02 2025 UTC |
php.ini :- extension_dir = /usr/lib/apache extension = pgsql.so After starting Apache, the following error appears in the error_log for Apache :- PHP Fatal error: Unable to load dynamic library '/usr/lib/apache/mysql.so!' - /usr/lib/apache/mysql.soA :No such file or directory in Unknown on line 0 The thing I noticed was the added ! and A on the library name in the error_log, it turns out it is related to the fact the extension_dir in php.ini has not got a trailing / so the emalloc for libpath in dl.c is wrong in this instance, the emalloc has a +1 for the 0 terminator but not any spare space for the / added in the sprintf so the fix is to change the +1 to +2, or apply the following patch :- (Note this bug is still there in RC1) --- php-4.0RC1/ext/standard/dl.c.orig Wed Mar 29 13:34:49 2000 +++ php-4.0RC1/ext/standard/dl.c Wed Mar 29 13:35:03 2000 @@ -88,7 +88,7 @@ && PG(extension_dir)[0]){ int extension_dir_len = strlen(PG(extension_dir)); - libpath = emalloc(extension_dir_len+file->value.str.len+1); + libpath = emalloc(extension_dir_len+file->value.str.len+2); if (PG(extension_dir)[extension_dir_len-1]=='/' || PG(extension_dir)[extension_dir_len-1]=='\\') { sprintf(libpath,"%s%s",PG(extension_dir),file->value.str.val);