0

I am stuck for 3 days. I used locate php.ini to find all php.ini files and its seem only one in my system, I also used phpinfo to locate and its points to same file. when I run php, its show a its missing shared file for zend debugger extension.

Warning: PHP Startup: `Unable to load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20160303/gmp.so' - /opt/lampp/lib/php/extensions/no-debug-non-zts-20160303/gmp.so: cannot open shared object file: No such file or directory in Unknown on line 0`

I have gone through the php.ini file

locate php.ini
/opt/lampp/etc/php.ini
/opt/lampp/etc/php.ini-pre1.7.2

I found no trace of string for debug extension. How get rid of it. I am also trying to add gmp extension .

php --ini
PHP Warning:  PHP Startup: Unable to load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20160303/gmp.so' - /opt/lampp/lib/php/extensions/no-debug-non-zts-20160303/gmp.so: cannot open shared object file: No such file or directory in Unknown on line 0

after running php --ini

  Warning: PHP Startup: Unable to load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20160303/gmp.so' - /opt/lampp/lib/php/extensions/no-debug-non-zts-20160303/gmp.so: cannot open shared object file: No such file or directory in Unknown on line 0
    Configuration File (php.ini) Path: /opt/lampp/etc
    Loaded Configuration File:         /opt/lampp/etc/php.ini
    Scan for additional .ini files in: (none)
    Additional .ini files parsed:      (none)
  • 1
    How did you install your lamp stack? Any reason for why you didn't use tasksel or apt to install them? – Dan Oct 11 '17 at 12:46
  • you are using /opt/lampp/etc/php.ini . You need to look at the contents of that file for any references to debug extensions. You can also locate gmp.so and copy it to /opt/lampp/lib/php/extensions/no-debug-non-zts-20160303/ – Panther Oct 11 '17 at 14:11
  • @Dan I downloaded the lampp suite and run the bundler – user746157 Oct 12 '17 at 05:15
  • @bodhi.zazen locate gmp.so and copied to back to /opt/lampp/lib/php/extensions/no-debug-non-zts-20160303/ and I got this `PHP Warning: PHP Startup: gmp: Unable to initialize module Module compiled with module API=20151012 PHP compiled with module API=20160303 These options need to match in Unknown on line 0

    Warning: PHP Startup: gmp: Unable to initialize module Module compiled with module API=20151012 PHP compiled with module API=20160303 These options need to match in Unknown on line 0`

    – user746157 Oct 12 '17 at 05:24
  • 1
    @user746157 Sorry I'm not familiar with it, so I can't help much. This is not the answer you are looking for, but instead of installing it through a third party app, I would recommend installing and using the default packages from the Ubuntu repositories as they are heavily tested and stable. https://askubuntu.com/questions/34/whats-the-easiest-way-to-set-up-a-lamp-stack – Dan Oct 12 '17 at 09:09
  • What is the "lampp suite" and why did you install LAMP that way ? Normally you install with apt or apt-get. php is difficult to compile and if you are compiling from source or installing something outside the repositories you really need to provide us with such information. What options did you pass to php ? – Panther Oct 12 '17 at 14:11
  • Those php errors (module API errors) generally are because of conflicting versions of php or custom php.ini or related to your path. See https://github.com/Homebrew/homebrew-php/issues/151 or google search the error message for similar discussion, but you have not provided enough detail for us to debug – Panther Oct 12 '17 at 14:19

1 Answers1

1

Take a look at Dan's question.

It appears you've somehow ended up with two different versions of PHP installed.

This is why Dan asked how you installed.

My suggestion is however you installed, deinstall PHP completely + start again, only using one installation tool. I'd suggest apt or apt-get only... till you get a working install.

You'll know you've successfully deleted all of PHP when /etc/php is completely empty.

You can refer to Installing Apache-2.4.28 + PHP-5.6 which I posted earlier today about how to install latest stable packages from the Launchpad PPA, which contains latest stable releases.

Since your referencing the /opt/lampp, this indicates you've attempting to use some custom installation tool or method, so you're mixing your custom install with the system install, which is doomed to instability.

This means you should also likely rm -rf /opt/lampp as part of your cleanup process + remove any related systemd files + any other non-apt cruft you've installed + remove any related, system wide, PATH settings.

Mixing install methods tends to either fail completely or randomly during various runtime operations.

Best to only use the normal system install methods, which will never reference /opt/lampp directories.

David Favor
  • 196
  • 5