E
E
empr2014-08-02 10:11:05
PHP
empr, 2014-08-02 10:11:05

PHP only sees manually installed extensions in CLI mode. How can I make it see them when run as an Apache module?

The most unpleasant situation - PHP 5.4, as well as 5.5 on my server (CentOS) flatly refuses to see extensions that I install myself.
Tried with Runkit and MongoDB, and everywhere the same symptoms: when running the script through the command line, as well as when calling php -m, these extensions work fine and are visible. However, it is worth calling the script through the browser, and that's it: Class Mongo not found.
Same with Runkit.
Initially, I suspected that there might be two different php.ini, but I checked it through phpinfo - no, in both cases the same config is used. Moreover, in both cases, PHP "picks up" mongo.ini (which contains the line: extension=mongo.so ), which is also visible in phpinfo(). But the extension itself does not load.
display_startup_errorsno result - silence.
Doing setenforce 0 on the command line didn't help either.
The .so files are in /usr/lib64/php/modules/ , and /usr/lib64/php-zts/modules/ . The second path is specified in php.ini.
They are assembled normally, without errors - both through pecl install and manually.
What can be wrong?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Igor, 2014-08-02
@merryjane

Are there enough rights to .so files for apache?
Try for a test, for example, set 777.

D
dzenovich, 2015-10-02
@dzenovich

Apache extensions must be built with zts and placed in the /usr/lib64/php-zts/modules/ folder. These must be different files than those in the /usr/lib64/php/modules/ directory and must be compiled with different flags. Try using the --with-php-config option when running ./configure before building the module (a build usually consists of three parts: phpize, ./configure, make install).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question