LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 09-09-2010, 08:10 PM   #1
jraidan
LQ Newbie
 
Registered: Sep 2010
Location: Austin, TX
Distribution: slackware
Posts: 4

Rep: Reputation: 0
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?

TIA

Jerry
 
Old 09-09-2010, 08:41 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Root's PATH will usually be different to standard users.. can you run 'which php' as both users to see if it's actually the same executable ?

cheers
 
Old 09-09-2010, 09:08 PM   #3
jraidan
LQ Newbie
 
Registered: Sep 2010
Location: Austin, TX
Distribution: slackware
Posts: 4

Original Poster
Rep: Reputation: 0
They're exactly the same. /usr/bin/php

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.

Jerry
 
Old 09-09-2010, 09:36 PM   #4
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Maybe permissions on the actual module binaries ?
 
Old 09-09-2010, 10:37 PM   #5
jraidan
LQ Newbie
 
Registered: Sep 2010
Location: Austin, TX
Distribution: slackware
Posts: 4

Original Poster
Rep: Reputation: 0
donut think so...

-> ls -al /usr/lib/php/extensions/
total 4244K
drwxr-xr-x 2 root root 4096 2010-08-25 15:22 .
drwxr-xr-x 14 root root 4096 2010-08-25 15:13 ..
-rwxr-xr-x 1 root root 29896 2010-08-25 15:22 bcmath.so
-rwxr-xr-x 1 root root 19268 2010-08-25 15:22 bz2.so
-rwxr-xr-x 1 root root 24804 2010-08-25 15:22 calendar.so
-rwxr-xr-x 1 root root 10780 2010-08-25 15:22 ctype.so
-rwxr-xr-x 1 root root 57240 2010-08-25 15:22 curl.so
-rwxr-xr-x 1 root root 49532 2010-08-25 15:22 dba.so
-rwxr-xr-x 1 root root 27844 2010-08-25 15:22 dbase.so
-rwxr-xr-x 1 root root 47488 2010-08-25 15:22 exif.so
-rwxr-xr-x 1 root root 43152 2010-08-25 15:22 ftp.so
-rwxr-xr-x 1 root root 360716 2010-08-25 15:22 gd.so
-rwxr-xr-x 1 root root 8596 2010-08-25 15:22 gettext.so
-rwxr-xr-x 1 root root 39708 2010-08-25 15:22 gmp.so
-rwxr-xr-x 1 root root 32140 2010-08-25 15:22 iconv.so
-rwxr-xr-x 1 root root 40028 2010-08-25 15:22 ldap.so
-rwxr-xr-x 1 root root 1847224 2010-08-25 15:22 mbstring.so
-rwxr-xr-x 1 root root 6980 2010-08-25 15:22 mhash.so
-rwxr-xr-x 1 root root 44884 2010-08-25 15:22 mysql.so
-rwxr-xr-x 1 root root 98288 2010-08-25 15:22 mysqli.so
-rwxr-xr-x 1 root root 81732 2010-08-25 15:22 openssl.so
-rwxr-xr-x 1 root root 86164 2010-08-25 15:22 pdo.so
-rwxr-xr-x 1 root root 23004 2010-08-25 15:22 pdo_mysql.so
-rwxr-xr-x 1 root root 394048 2010-08-25 15:22 pdo_sqlite.so
-rwxr-xr-x 1 root root 19484 2010-08-25 15:22 pspell.so
-rwxr-xr-x 1 root root 7524 2010-08-25 15:22 shmop.so
-rwxr-xr-x 1 root root 23012 2010-08-25 15:22 snmp.so
-rwxr-xr-x 1 root root 314920 2010-08-25 15:22 soap.so
-rwxr-xr-x 1 root root 336796 2010-08-25 15:22 sqlite.so
-rwxr-xr-x 1 root root 14072 2010-08-25 15:22 tokenizer.so
-rwxr-xr-x 1 root root 29124 2010-08-25 15:22 wddx.so
-rwxr-xr-x 1 root root 24208 2010-08-25 15:22 xsl.so
-rwxr-xr-x 1 root root 65876 2010-08-25 15:22 zip.so
-rwxr-xr-x 1 root root 25620 2010-08-25 15:22 zlib.so
 
Old 09-10-2010, 01:36 AM   #6
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Can you create/visit a phpinfo page ?
 
Old 09-10-2010, 01:40 AM   #7
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 2,407

Rep: Reputation: 853Reputation: 853Reputation: 853Reputation: 853Reputation: 853Reputation: 853Reputation: 853
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).

Last edited by ponce; 09-10-2010 at 01:50 AM.
 
1 members found this post helpful.
Old 09-10-2010, 07:18 AM   #8
jraidan
LQ Newbie
 
Registered: Sep 2010
Location: Austin, TX
Distribution: slackware
Posts: 4

Original Poster
Rep: Reputation: 0
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!
 
  


Reply

Tags
cli, missing, modules, php, slack


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Different date shown for regular user and root user tuxtutorials Linux - Server 6 11-27-2013 08:33 AM
Moving from root to regular user KingOfDreams Linux - General 1 01-14-2005 04:46 AM
Given regular user root privileges clo99dx Linux - Newbie 6 06-05-2004 04:27 PM
GURUS HELP: Firewall,XP Share,root user,missing modules ganja_guru Slackware 0 04-19-2004 01:29 PM
can't login as regular user (root only) DontKnowNothing Mandriva 2 10-24-2003 01:36 PM


All times are GMT -5. The time now is 01:27 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration