2

My development environment:

Linux - Linux localhost.localdomain 2.6.9-42.

apache:2.2.4

php:5.2.3

I wrote a php extension hello.

when i make test it show me:

PHP Warning: Module 'hello' already loaded in Unknown on line 0

PHP Warning: Module 'hello' already loaded in Unknown on line 0

I check the php.ini , there is just one line extension=hello.so.

I delete extension=hello.so in php.ini, then make test successfully, but the hello module isn't loaded by webserver process.

What should i do?

Artefacto
  • 96,375
  • 17
  • 202
  • 225
Vector.Lee
  • 33
  • 1
  • 1
  • 5
  • Load it manually with dl(). If the error message persists, it's more likely a code/build error than a configuration glitch. – mario Aug 19 '10 at 05:21
  • thanks. I tried and the web browser show me: Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=/usr/local/php/ext/hello.so in your php.ini – Vector.Lee Aug 20 '10 at 02:48
  • /usr/local/php/bin/php -c /usr/local/php/lib/php.ini -f /home/html/ext/hello_test.php This command executed successful. – Vector.Lee Aug 20 '10 at 02:58
  • This is a duplicate of this question that has been correctly answered unlike this one ---> http://stackoverflow.com/questions/19653926/php-remove-fix-module-not-found-or-already-loaded-warnings – NickNo Jun 11 '14 at 14:55

3 Answers3

0

I think to remember the error message is actually misleading, in my case (a while ago) I had a similar message because of a link problem inside the module.

greg
  • 696
  • 1
  • 9
  • 16
  • Thanks.yea,I wrote a shared library php_help which linked against the static libraries boost_date_time.a and boost_thread.a and linked hello.so against libphp_help.so. when i execute command make for php_help, gcc show me the warning message *** Warning: Linking the shared library libphp_help.la against the *** static library /usr/local/lib/libboost_date_time.a is not portable! *** Warning: Linking the shared library libphp_help.la against the *** static library /usr/local/lib/libboost_thread.a is not portable! What does it mean? – Vector.Lee Aug 20 '10 at 02:25
  • I can`t find the file libphp_help.a after command make finished. But libphp_help.a will be created in folder /usr/local/lib when i execute command make install. I think something is wrong. php_help`s makefile.am: AUTOMAKE_OPTIONS=foreign lib_LTLIBRARIES=libphp_help.la INCLUDES=-I/usr/local/include/boost-1_43 -I./include libphp_help_la_SOURCES=./src/php_help.cpp\ ./src/log.cpp libphp_help_la_LIBADD=/usr/local/lib/libboost_date_time.a /usr/local/lib/libboost_thread.a -lpthread – Vector.Lee Aug 20 '10 at 02:26
0

It's a harmless warning, but I usually see this when people have the same INI file being processed multiple times (for example, if they have it symlinked somewhere under "Scan this dir for additional .ini files")

TML
  • 12,813
  • 3
  • 38
  • 45
0

It looks like nobody will view this question anymore, so i will say what i think. Make test will start up the php and loaded the make extension file which is not in the dir declared in php.ini. There must be another extension file which in the dir declared in php.ini is already loaded by php. so php loaded two extensions with the same name.

Vector.Lee
  • 33
  • 1
  • 1
  • 5