Jump to content

How to enable RPC XML extension on PHP?


Recommended Posts

Dear All,

 

We are desperate for a solution and our project is stuck since 2 weeks, cannot launch !

 

We have a root server. We need to create an automatic FTP username password for users who register on our website. We have been able to generate this via XML RPC and but cannot install it in PHP as our code is written in PHP. It's become highly frustrating and any assistance in this would be highly appreciated.

 

Can someone get us through this small issue?

 

Thanks everyone for looking into this.

 

Regards

Mani

Link to comment
Share on other sites

Normally this sort of thing is handled by putting authentication in a database; the FTP server software looks in there for the username and password, as well as home directory and whatnot, rather than in a file or expecting system-level users.

 

Your post is a bit lacking in details. What can't you do? Generate what with XML RPC? You can't install something in PHP because the code is written in PHP?

Link to comment
Share on other sites

Thanks for your reply. 

 

XML RPC extension is enabled on the server. In PHP code, its not generating a response. 

 

Can you help please? 

 

Here's the response code

 

<?php
 
require_once('PleskApiClient.php');
 
$host = getenv('REMOTE_HOST');
$login = getenv('REMOTE_LOGIN') ?: 'admin';
$password = getenv('REMOTE_PASSWORD');
 
$client = new PleskApiClient($host);
$client->setCredentials($login, $password);
 
$request = <<<EOF
<packet>
<ftp-user>
<add>
   <name>abhisheknew</name>
   <password>jdnHHbe6Gc</password>
   <home/>
   <webspace-id>1</webspace-id>
</add>
</ftp-user>
</packet>
EOF;
 
$response = $client->request($request);
print_r($response);
echo "Response: ".$response;
Link to comment
Share on other sites

No error or response, blank. When we are doing echo $response, no output..

 

Everything is working in XML, only bringing in PHP is the issue. Can we solve this?

 

XML request ok

 

<ftp-user>
<add>
   <name>abhisheknew</name>
   <password>jdnHHbe6Gc</password>
   <home/>
   <webspace-id>1</webspace-id>
</add>
</ftp-user>
 
 
This generated a user in ftp, but in PHP we cannot generate somehow..
 
IS there a way to connect with you sir?
Link to comment
Share on other sites

"echo $response" might not show anything. What does

var_dump($response);
show? If you say there's no output then there is some other problem and you probably don't have PHP set up to show errors properly.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.