mongodb - PHP - - ini "(none)" and not loading extensions -


so ran i'm hoping can understanding on. there clean centos machine clean install of php. had mongodb driver installed well. when accessing web app through browser, kept complaining mongo client didn't exist. of installation procedures followed, php.ini contained extension=mongo.so, , httpd restarted. php info() did not contain mongo conf. ended working adding mongo.ini file /etc/php.d directory extension=mongo.so written it.

i'm getting sneaky suspicion php.ini wasn't being loaded correctly, don't understand why. reason i'm thinking is, one, worked after adding mongo.ini. second, there mismatched php info() outputs cli , browser gui.

cli output

and gui

gui output

both of these snapped seconds apart. no configuration changes or restarts made. reason cli output says loaded configuration file /etc/php.ini expected. browser gui shows (none). going on here? why extension=mongo.so never loading php.ini file?

versions

apache/2.4.6 php/5.4.16 centos linux release 7.3.1611  [someuser@someserver etc]# find / -name php.ini  /etc/php.ini 

is proper place this? or should move different forum?

update

after reading grigory ilizirov's comments, , doing research, think question answered if wants post it. looks php configs apache wasn't being loaded. had assumed /etc/php.ini file needed edited. need figure out how heck i'm going that.

update 2

reverted clean install , did again. time around, same results cli , web gui before, mongo wouldn't load @ despite being added in /etc/php.d/mongo.ini. suspect selinux interferring apache. mongo.ini no longer showing in additional .ini file sections. disabling selinux , rebooting allows load apache.

final

this indeed selinux issue. then, belong on future users?

you need make sure php have installed mongodb extension.try use php -m see if have mongodb installed.

then download source code https://github.com/mongodb/mongo-php-driver-legacy.

follow these steps install extension:

tar zxvf mongo-x.x.x.tgz -c ../ cd mongo-x.x.x/ phpize ./configure --with-php-config=/usr/local/php/bin/php-config make clean make make install extension=mongo.so //add line php.ini 

after install try run php -m again, see if extension installed success.

for more info, should read php doc.http://php.net/manual/en/mongo.installation.php#mongo.installation.fedora


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -