php-cli no mysql module for non-root

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • DBenson

    php-cli no mysql module for non-root

    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,cale ndar,ctype,dba, dbase,ftp,gd,gm p,imap,mysql,op enssl,overload, pcre,
    posix,session,s hmop,sockets,st andard,sysvsem, sysvshm,tokeniz er,xml,yp,zlib

    Module list as non-root:
    bcmath,bz2,cale ndar,ctype,dba, dbase,ftp,gd,gm p,imap,openssl, overload,pcre,p osix,
    session,shmop,s ockets,standard ,sysvsem,sysvsh m,tokenizer,xml ,yp,zlib


    Thanks,
    DBenson


  • Pedro Graca

    #2
    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 =--

    Comment

    • DBenson

      #3
      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)...


      Comment

      Working...