Remoting Access - create a user

Discussion in 'Installation/Configuration' started by dayjahone, Jul 5, 2007.

  1. dayjahone

    dayjahone Member

    I installed Remoting Access, created a user, changed the server, user, and password in the test.php file. I uncommented the part to add a user. I uploaded the two php files to the /web directory. When I go to http://mydomain.com/test.php, I get the following error?

    Code:
    Fatal error: Cannot redeclare class soapclient in /var/www/web1/web/soap.lib.php on line 4101
    Eventually, I would like this to be a form that I can just fill out to create a user rather than changing the php file.

    This is what I changed:
    Code:
    include("soap.lib.php");
    
    // Insert here your 42go Server
    $server_url = "https://server1.mydomain.com:81";
    
    // creating object for SoapClient
    $soapclient = new soapclient($server_url.'/remote/index.php');
    
    // Username and Password of the remoting user (not identical
    // with the user to log into the web interface!)
    
    $parameters = array('user' => 'remotingAdmin',
                        'pass' =>  'password');
    
    // Login into 42go Server
    $session_id = $soapclient->call('login',$parameters);
    
    // Error Check
    if($err = $soapclient->getError()) die("Error: ".$err);
    
    /*
    and this is what I uncommented:
    Code:
    $params = array (         'sid'        => $session_id,
                                            'module'         => 'web',
                                            'function'         => 'user_add',
                                            'params'        => array ( web_title => 'mydomain.com',  // web_title or web_id
                                            user_username => 'mydomain.com_uwe',
                                            user_name => 'Uwe Meier',
                                            user_email => 'uwe',
                                            user_passwort => 'sagichnicht',
                                            user_speicher => 10,
                                            user_mailquota => 10,
                                            user_admin => 0
                                            ));
    
    $user_id = $soapclient->call('service',$params);
    if($err = $soapclient->getError()) die("Error: ".$err);
    print_r($user_id);
    
     
    Last edited: Jul 5, 2007
  2. Tommahawk

    Tommahawk New Member

    Your PHP is compiled with SOAP into it which conflicts with the Nusoap php soap implentation. Two maybe three options here either

    1) recompile PHP without soap using a flag (e.g --disable-soap)
    2) rename the functions so they are unique
    3) disable SOAP in your php.ini (easy & recommended if possible)


    BTW Complete list of PHP configure options
    http://aspn.activestate.com/ASPN/docs/PHP/install.configure.html

    BTW Take a moment I am selling one of my domains here
    HDNOISE.COM
    Bid here: http://www.sitepoint.com/marketplace/auction/9993
     
  3. dayjahone

    dayjahone Member

    I did the perfect setup on Ubuntu, then disabled xml to install remoting access. How do I disable SOAP in php.ini, and why would it not be possible? Thanks.
     
  4. falko

    falko Super Moderator Howtoforge Staff

  5. dayjahone

    dayjahone Member

    I went through the thread and did everything that was suggested (I think) and am still getting the error as well. Does anyone know how to disable soap? It seems like this is a normal problem when using remote access with ubuntu.

    Here are the results of my php test:
    Code:
    soap
    
    Soap Client	enabled
    Soap Server	enabled
    
    Directive	Local Value	Master Value
    soap.wsdl_cache	1	1
    soap.wsdl_cache_dir	/tmp	/tmp
    soap.wsdl_cache_enabled	1	1
    soap.wsdl_cache_limit	5	5
    soap.wsdl_cache_ttl	86400	86400 
    Code:
    # php -m
    PHP Warning:  Module 'json' already loaded in Unknown on line 0
    [PHP Modules]
    bcmath
    bz2
    calendar
    ctype
    curl
    date
    dba
    dom
    exif
    filter
    ftp
    gd
    gettext
    hash
    iconv
    imagick
    imap
    json
    libxml
    mbstring
    mcrypt
    memcache
    mhash
    mime_magic
    ming
    mysql
    mysqli
    ncurses
    openssl
    pcntl
    pcre
    PDO
    pdo_mysql
    pdo_sqlite
    posix
    ps
    pspell
    recode
    Reflection
    session
    shmop
    SimpleXML
    snmp
    soap
    sockets
    SPL
    SQLite
    standard
    sysvmsg
    sysvsem
    sysvshm
    tidy
    tokenizer
    wddx
    xml
    xmlreader
    xmlrpc
    xmlwriter
    xsl
    zip
    zlib
    
    [Zend Modules]
    I don't have the line "extension=php_soap.so" . . .

    Code:
    ~# grep extension /etc/php5/apache2/php.ini
    ; dynamically loaded extension (either a PHP extension or a Zend extension),
    ; you may only use these constants *after* the line that loads the extension.
    ; leading '/'. You must also specify the file extension being used including
    ; Directory in which the loadable extensions (modules) reside.
    ; extension_dir = "./"
    ; If you wish to have an extension loaded automatically, use the following
    ;   extension=modulename.extension
    ;   extension=msql.dll
    ;   extension=msql.so
    ; needs to go here.  Specify the location of the extension with the
    ; extension_dir directive above.
    ; Sets the directory name where SOAP extension will put cache files.
    extension=imagick.so
    extension=imap.so
    extension=json.so
    extension=mcrypt.so
    extension=memcache.so
    and
    Code:
    # ls -la /etc/php5/apache2/conf.dlrwxrwxrwx 1 root root 9 2007-06-29 16:08 /etc/php5/apache2/conf.d -> ../conf.d
     
    Last edited: Jul 6, 2007
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    If you can not disable soap, then use the soap functions that are compiled in your php version instead of the soap library that comes with the examples.
     
  7. dayjahone

    dayjahone Member

    I get the following errors if I don't use the soap.lib.php:
    Code:
    Warning: include(soap.lib.php) [function.include]: failed to open stream: No such file or directory in /var/www/web1/web/test.php on line 12
    
    Warning: include() [function.include]: Failed opening 'soap.lib.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/web1/web/test.php on line 12
    
    Warning: SoapClient::SoapClient(https://server1.mydomain.com:81/remote/index.php) [function.SoapClient-SoapClient]: failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error in /var/www/web1/web/test.php on line 18
    
    Warning: SoapClient::SoapClient() [function.SoapClient-SoapClient]: I/O warning : failed to load external entity "https://erver1.mydomain.com:81/remote/index.php" in /var/www/web1/web/test.php on line 18
    
    Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://erver1.mydomain.com:81/remote/index.php' in /var/www/web1/web/test.php:18 Stack trace: #0 /var/www/web1/web/test.php(18): SoapClient->SoapClient('https://server1...') #1 {main} thrown in /var/www/web1/web/test.php on line 1
    Has anyone gotten remoting access to work on Ubuntu feisty fawn?
     
    Last edited: Jul 10, 2007
  8. dayjahone

    dayjahone Member

    Last edited: Jul 11, 2007

Share This Page