[SOLVED] cli php missing modules as regular user but not as root
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
cli php missing modules as regular user but not as root
My cli php is missing modules as regular user but not as root. In particular, mysql is missing... which is how I came across this issue.
I'm running Slack 12.2 w/ php 5.2.14, standard Slack packages.
As a normal unprivileged user:
-> whoami ; php -v ; php -m |wc -l ; php -m |grep mysql
jerry
PHP 5.2.14 (cli) (built: Aug 25 2010 15:17:31)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
26
As root:
-> whoami ; php -v ; php -m |wc -l ; php -m | grep mysql
root
PHP 5.2.14 (cli) (built: Aug 25 2010 15:17:31)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
58
mysql
mysqli
pdo_mysql
I've tried reinstalling php and it made no difference. php.ini is not to blame. I've Google'd this to death, no luck. Anyone have a shove in the right direction or a clue to share for this problem?
I have 3 other Slack 12.2 installs very similar to this one. Only one of them does not have this problem. I compared the installed packages & php configurations between all of the servers. The only differences are packages unrelated to php... proftp, jdk, and some X libraries. I use the same Slack mirror for all of these servers. Very bizarre.
I've tried on my installs, creating another generic user and it can see all the modules, extensions included.
Then I saw in "man php" the -n option, that starts php without reading the .ini file and launching it like this it shows only the builtin modules.
I think in your case is not finding/reading that file (so he doesn't activate extensions): maybe you have to launch it specifying with the -c option the location of the php.ini.
obviously, I would check also if your user can read it making him issue a
Code:
cat /path/to/php.ini
can be also some directory permission are changed from the default (you tell us on one machine it works ok: I think a clean slack 12.2 don't behave like that -I tried on -current).
A fresh day with a fresh set of eyes (and a few cups of coffee) revealed that it was the permissions on the php.ini file. /etc/httpd/php.ini was missing +r for all users. Running the command "php -c /etc/httpd/php.ini -m" didn't throw a "Permission denied" error so I didn't think to check the read permissions of the file. *slaps forehead*
Many thanks to everyone that chimed in with suggestions, much appreciated!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.