Changes made to cli's php.ini not taking effect

Posted by Sandeepan Nath on Server Fault See other posts from Server Fault or by Sandeepan Nath
Published on 2011-01-31T12:49:58Z Indexed on 2011/01/31 15:27 UTC
Read the original article Hit count: 927

Filed under:
|
|
|

I have two php.ini files -

  • /etc/php.ini which loads in case of cli
  • /opt/lampp/etc/php.ini which loads in case of browser.

I am able to use PHP's Mailparse extension after adding the line extension=mailparse.so in the /opt/lampp/etc/php.ini and restarting lampp.

But I am not able to load the same in case of command line -

getting PHP Fatal error: Call to undefined function mailparse_msg_create() in ...

mailparse_msg_create() is a part of the Mailparse extension.

I tried by relogging with the user after making the change and even restarting the system. What needs to be done so that the change takes effect.

Update

I checked that php -i | grep 'Configuration File' gives

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mailparse.so' - /usr/lib/php/modules/mailparse.so: cannot open shared object file: No such file or directory in Unknown on line 0
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini

Update 2
I copied the mailparse.so from /opt/lampp/lib/php/extensions/no-debug-non-zts-20090626 and put it in /usr/lib/php/modules. I added extension=mailparse.so to /etc/php.ini as well. But it still showed this warning

PHP Warning:  PHP Startup: Unable to load dynamic library ...  

As told by Lekensteyn, I did

ldd /usr/lib/php/modules/mailparse.so

and got

ldd: warning: you do not have execution permission for /usr/lib/php/modules/mailparse.so'

So I gave execute permission. Then

ldd /usr/lib/php/modules/mailparse.so

showed

linux-gate.so.1 => (0x00110000) libc.so.6 => /lib/libc.so.6 (0x0011d000) /lib/ld-linux.so.2 (0x003aa000)

which looks normal. BUt now, running php command says

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mailparse.so' - /usr/lib/php/modules/mailparse.so: undefined symbol: mbfl_name2no_encoding in Unknown on line 0

© Server Fault or respective owner

Related posts about linux

Related posts about php.ini