Information Technology Solutions, Answers and Experts
Write an Article Ask a Question

php-cli no mysql module for non-root

DBenson
P: n/a
DBenson
So far I've been unable to find anything that addresses this one...

Basically, if I am logged in as root and issue a "php -m", mysql is in the
list of installed modules. If I log in or su to a normal user and do the
same then mysql is *not* in the list and I cannot use mysql_connect (or any
other mysql function)...

Any ideas on why this is or how to fix it?


Notes:

# php -v
PHP 4.3.3 (cgi-fcgi) (built: Nov 4 2003 14:05:47)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies

Module list as root:
bcmath,bz2,calendar,ctype,dba,dbase,ftp,gd,gmp,ima p,mysql,openssl,overload,pcre,
posix,session,shmop,sockets,standard,sysvsem,sysvs hm,tokenizer,xml,yp,zlib

Module list as non-root:
bcmath,bz2,calendar,ctype,dba,dbase,ftp,gd,gmp,ima p,openssl,overload,pcre,posix,
session,shmop,sockets,standard,sysvsem,sysvshm,tok enizer,xml,yp,zlib


Thanks,
DBenson


Jul 17 '05 #1

2 Replies



Pedro Graca
P: n/a
Pedro Graca

re: php-cli no mysql module for non-root

DBenson wrote:[color=blue]
> So far I've been unable to find anything that addresses this one...
>
> Basically, if I am logged in as root and issue a "php -m", mysql is in the
> list of installed modules. If I log in or su to a normal user and do the
> same then mysql is *not* in the list and I cannot use mysql_connect (or any
> other mysql function)...
>
> Any ideas on why this is or how to fix it?[/color]

Maybe doing a diff between two "php -i"s will reveal why that happens.
For me both root and normal user have the same modules installed.

Can't you

<?php dl('mysql.so') ?>

load the mysql extension at runtime?
[color=blue]
> Notes:
>
> # php -v
> PHP 4.3.3 (cgi-fcgi) (built: Nov 4 2003 14:05:47)
> Copyright (c) 1997-2003 The PHP Group
> Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies[/color]

$ php -v
PHP 4.3.3 (cli) (built: Jan 25 2004 23:17:16)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #2

DBenson
P: n/a
DBenson

re: php-cli no mysql module for non-root

Pedro Graca wrote:
[color=blue]
> DBenson wrote:[color=green]
>> So far I've been unable to find anything that addresses this one...
>>
>> Basically, if I am logged in as root and issue a "php -m", mysql is in
>> the
>> list of installed modules. If I log in or su to a normal user and do the
>> same then mysql is *not* in the list and I cannot use mysql_connect (or
>> any other mysql function)...
>>
>> Any ideas on why this is or how to fix it?[/color]
>
> Maybe doing a diff between two "php -i"s will reveal why that happens.
> For me both root and normal user have the same modules installed.
>
> Can't you
>
> <?php dl('mysql.so') ?>
>
> load the mysql extension at runtime?
>[color=green]
>> Notes:
>>
>> # php -v
>> PHP 4.3.3 (cgi-fcgi) (built: Nov 4 2003 14:05:47)
>> Copyright (c) 1997-2003 The PHP Group
>> Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies[/color]
>
> $ php -v
> PHP 4.3.3 (cli) (built: Jan 25 2004 23:17:16)
> Copyright (c) 1997-2003 The PHP Group
> Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies[/color]

dl('mysql.so') wasn't allowed but did provide another clue...**I*think*that
php is running is safe_mode for non-root but I can't figure out why (all
the related options in php.ini are off)...


Jul 17 '05 #3

Post your reply

Sign in to post your reply or Sign up for a free account.



Didn't find the answer to your question? Post your PHP question on Bytes

You can also browse similar questions: PHP php-cli mysql

Get PHP Help

Get PHP help from a network of professionals.

Post your Question » Over 331,212 Members | 3356 Online